]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonmapMonitor: initialize new cluster monmap with default persistent features
authorSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 04:11:21 +0000 (00:11 -0400)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:06:49 +0000 (13:06 -0400)
This is similar to what we do for OSDMonitor::create_initial().

Avoid setting these initial features just for teh mon test that verifies
persistent features get set on a full quorum.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/mon/MonmapMonitor.cc
src/mon/OSDMonitor.cc
src/test/mon/misc.sh

index fcecf80ea83eb23069ae3dcf1c9edce5db6e59c1..b1d1dfc8f7be74e4d3c989cf3ed3bb7243595ce9 100644 (file)
@@ -380,6 +380,7 @@ OPTION(mon_debug_dump_json, OPT_BOOL, false)
 OPTION(mon_debug_dump_location, OPT_STR, "/var/log/ceph/$cluster-$name.tdump")
 OPTION(mon_debug_no_require_luminous, OPT_BOOL, false)
 OPTION(mon_debug_no_require_bluestore_for_ec_overwrites, OPT_BOOL, false)
+OPTION(mon_debug_no_initial_persistent_features, OPT_BOOL, false)
 OPTION(mon_inject_transaction_delay_max, OPT_DOUBLE, 10.0)      // seconds
 OPTION(mon_inject_transaction_delay_probability, OPT_DOUBLE, 0) // range [0, 1]
 
index e61b1a4bb26129dba08a028e0cd57f3cc9e64302..b5ac990dfd063e73d3b5b21d19b4278cb4c05542 100644 (file)
@@ -40,6 +40,14 @@ void MonmapMonitor::create_initial()
   dout(10) << "create_initial using current monmap" << dendl;
   pending_map = *mon->monmap;
   pending_map.epoch = 1;
+
+  if (g_conf->mon_debug_no_initial_persistent_features) {
+    derr << __func__ << " mon_debug_no_initial_persistent_features=true"
+        << dendl;
+  } else {
+    // initialize with default persistent features for new clusters
+    pending_map.persistent_features = ceph::features::mon::get_persistent();
+  }
 }
 
 void MonmapMonitor::update_from_paxos(bool *need_bootstrap)
index fc951c6bdb14aebc9be49e9d340b809ecbb417c8..6924efb2c6acd343a0ef938ebd78707ad9c6d726 100644 (file)
@@ -223,6 +223,7 @@ void OSDMonitor::create_initial()
   // new cluster should require latest by default
   if (g_conf->mon_debug_no_require_luminous) {
     newmap.require_osd_release = CEPH_RELEASE_KRAKEN;
+    derr << __func__ << " mon_debug_no_require_luminous=true" << dendl;
   } else {
     newmap.require_osd_release = CEPH_RELEASE_LUMINOUS;
     newmap.full_ratio = g_conf->mon_osd_full_ratio;
index 7daf378b80e63839552b78cc4a6d253db6dd9b05..2002ecd8944c77dbef25eb22050e1a094085d05c 100755 (executable)
@@ -192,6 +192,8 @@ function TEST_mon_features() {
     CEPH_ARGS="--fsid=$fsid --auth-supported=none "
     CEPH_ARGS+="--mon-initial-members=a,b,c "
     CEPH_ARGS+="--mon-host=$MONA,$MONB,$MONC "
+    CEPH_ARGS+="--mon-debug-no-initial-persistent-features "
+    CEPH_ARGS+="--mon-debug-no-require-luminous "
 
     run_mon $dir a --public-addr $MONA || return 1
     run_mon $dir b --public-addr $MONB || return 1