You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when the app uses sharding and the migration is run, there is not way to tell on which shard it is being run.
This is a problem, because when the migration adds a unique index and we have some duplicates, the migration blows up (with a ActiveRecord::RecordNotUnique error) and there is no way to easily know on which shard exactly.
Currently, when the app uses sharding and the migration is run, there is not way to tell on which shard it is being run.
This is a problem, because when the migration adds a unique index and we have some duplicates, the migration blows up (with a
ActiveRecord::RecordNotUnique
error) and there is no way to easily know on which shard exactly.The problem can be solved in at least 2 ways:
puts
shard info when running a migrationconnection_pool
object attached to the mentionedActiveRecord::RecordNotUnique
error (thanks to Storeconnection_pool
in database-related exceptions #48295), but the error message is not include this info (Storeconnection_pool
in database-related exceptions #48295 (comment)), so needs to fix thatI would like to provide a PR, but need a suggestion on which path to choose.
@byroot you helped to implement the linked PR, can you please suggest?
The text was updated successfully, but these errors were encountered: