diff options
| author | elijah <elijah@riseup.net> | 2016-02-02 18:06:05 -0800 | 
|---|---|---|
| committer | elijah <elijah@riseup.net> | 2016-02-23 09:50:58 -0800 | 
| commit | 86ae854d0eaac7ee2f88348eb71b4335a4854fa1 (patch) | |
| tree | f0ed1cff32e27636f0c3431b52aab8a27b9e411b | |
| parent | 8eec2d89983934868c9be07d55825cbe3bdcdaaf (diff) | |
allow legacy plain couchdb nodes to stay couchdb nodes, although issue a warning.
| -rw-r--r-- | provider_base/services/couchdb.rb | 24 | 
1 files changed, 23 insertions, 1 deletions
| diff --git a/provider_base/services/couchdb.rb b/provider_base/services/couchdb.rb index 124c1b6c..8271b9c5 100644 --- a/provider_base/services/couchdb.rb +++ b/provider_base/services/couchdb.rb @@ -6,11 +6,33 @@  # to always use plain couchdb, unless there are more than one couchdb  # node or if "couch.mode" property is set to "multimaster".  # +# in the past, it used to work like this: +# +# * if couch.master was set to true on one node, then do plain couchdb. +# * if couch.master was not set anywhere, then do bigcouch. +# * if couch.master was set on more than one node, then do bigcouch. +# +# Some of this legacy logic is still supported so that upgrading does +# not unexpectedly turn bigcouch nodes into plain couchdb nodes. +# + +if self.couch['master'] +  LeapCli::log :warning, "The node property 'couch.master' is deprecated.\n" + +    "   In the future, you must set 'couch.mode' to either 'plain' or 'multimaster'.\n" + +    "   (node '#{self.name}')" +end  couchdb_nodes = nodes_like_me['services' => 'couchdb'] -if couchdb_nodes.size > 1 || self['couch']['mode'] == "multimaster" +if couchdb_nodes.size > 1    apply_partial 'services/_couchdb_multimaster.json' +elsif self.couch.mode == "multimaster" +  if self.couch['master'] +    # The old deprecated way of specifying plain couch is still being used +    apply_partial 'services/_couchdb_plain.json' +  else +    apply_partial 'services/_couchdb_multimaster.json' +  end  else    apply_partial 'services/_couchdb_plain.json'  end | 
