octopus
octopus copied to clipboard
Per environment master shard
In many setups, the default master shard might be a different database server in each environment. A single master_shard
config setting doesn't fit. This patch first checks the shards.yml for octopus
=> master_shards
=> Rails env for a setting, and still falls back to octopus
=> master_shard
if it doesn't exist.
Example:
octopus:
master_shard: fallback
master_shards:
development: dev1
production: lion
environments:
- development
- production
development:
dev1: . . .
dev2: . . .
production:
lion: . . .
tiger: . . .
@calh - any updates on this PR? is this ready for review / merge?
@thiagopradi, yes, I'm using this in production right now as well, and it's a key requirement for how our environments are set up. We have different database server names for development and production, and the master shard setting needs to be there to properly initialize the rails app.
I shouldn't have probably merged in the ibm_db branch along with this PR. The only commit that's needed here is 1d07220. If you wanted to merge this separately from the ibm_db PR I could close & recreate this with just that single commit.
Thank you!