octopus icon indicating copy to clipboard operation
octopus copied to clipboard

Per environment master shard

Open calh opened this issue 5 years ago • 2 comments

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 avatar Aug 28 '19 19:08 calh

@calh - any updates on this PR? is this ready for review / merge?

thiagopradi avatar Sep 25 '19 02:09 thiagopradi

@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!

calh avatar Sep 25 '19 14:09 calh