From: Radoslaw Zarzynski Date: Thu, 4 Aug 2022 10:06:42 +0000 (+0000) Subject: doc, common, mon, qa: Mon-related updates for reef X-Git-Tag: v18.1.0~1075^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=905540db1465b28bb76253c0f29ec78584d8ddf4;p=ceph.git doc, common, mon, qa: Mon-related updates for reef This bases on two commits: * 7bbc92eda368dc70a421eed600532a165f5aecc1 and * 6b22d478634f3f2a3b57f4a674c45ac2ba61513a which seems to be a fixup to former one. In contrast to them, in `OSDMonitor::create_initial()` I updated also `newmap.require_osd_release` to pacific when `mon_debug_no_require_reef` and `mon_debug_no_require_quincy`. Please take have an extra look on that during the review. Signed-off-by: Radoslaw Zarzynski --- diff --git a/doc/dev/release-checklists.rst b/doc/dev/release-checklists.rst index 2ec9ac75abc..91172c29569 100644 --- a/doc/dev/release-checklists.rst +++ b/doc/dev/release-checklists.rst @@ -63,15 +63,15 @@ Compatsets Mon --- -- [ ] qa/standalone/mon/misc adjust `TEST_mon_features` (add X cases and adjust `--mon-debug-no-require-X`) +- [x] qa/standalone/mon/misc adjust `TEST_mon_features` (add X cases and adjust `--mon-debug-no-require-X`) - [x] mon/MgrMonitor.cc adjust `always_on_modules` -- [ ] common/options.cc define `mon_debug_no_require_X` -- [ ] common/options.cc remove `mon_debug_no_require_X-2` -- [ ] mon/OSDMonitor.cc `create_initial`: adjust new `require_osd_release`, and add associated `mon_debug_no_require_X` -- [ ] mon/OSDMonitor.cc `preprocess_boot`: adjust "disallow boot of " condition to disallow X if `require_osd_release` < X-2. -- [ ] mon/OSDMonitor.cc: adjust "osd require-osd-release" to (1) allow setting X, and (2) check that all mons *and* OSDs have X -- [ ] mon/MonCommands.h: adjust "osd require-osd-release" allows options to include X -- [ ] qa/workunits/cephtool/test.sh: adjust `require-osd-release` test +- [x] common/options/global.yaml.in define `mon_debug_no_require_X` +- [x] common/options/global.yaml.in remove `mon_debug_no_require_X-2` +- [x] mon/OSDMonitor.cc `create_initial`: adjust new `require_osd_release`, and add associated `mon_debug_no_require_X` +- [x] mon/OSDMonitor.cc `preprocess_boot`: adjust "disallow boot of " condition to disallow X if `require_osd_release` < X-2. +- [x] mon/OSDMonitor.cc: adjust "osd require-osd-release" to (1) allow setting X, and (2) check that all mons *and* OSDs have X +- [x] mon/MonCommands.h: adjust "osd require-osd-release" allows options to include X +- [x] qa/workunits/cephtool/test.sh: adjust `require-osd-release` test Code cleanup diff --git a/qa/standalone/mon/misc.sh b/qa/standalone/mon/misc.sh index 900501fa367..f7d349e9eb8 100755 --- a/qa/standalone/mon/misc.sh +++ b/qa/standalone/mon/misc.sh @@ -172,7 +172,7 @@ function TEST_mon_features() { 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-quincy " + CEPH_ARGS+="--mon-debug-no-require-reef " run_mon $dir a --public-addr $MONA || return 1 run_mon $dir b --public-addr $MONB || return 1 @@ -183,7 +183,8 @@ function TEST_mon_features() { jq_success "$jqinput" '.monmap.mons | length == 3' || return 1 # quorum contains two monitors jq_success "$jqinput" '.quorum | length == 2' || return 1 - # quorum's monitor features contain kraken, luminous, mimic, nautilus, octopus, pacific + # quorum's monitor features contain kraken, luminous, mimic, nautilus, + # octopus, pacific, quincy jqfilter='.features.quorum_mon[]|select(. == "kraken")' jq_success "$jqinput" "$jqfilter" "kraken" || return 1 jqfilter='.features.quorum_mon[]|select(. == "luminous")' @@ -198,6 +199,8 @@ function TEST_mon_features() { jq_success "$jqinput" "$jqfilter" "pacific" || return 1 jqfilter='.features.quorum_mon[]|select(. == "quincy")' jq_success "$jqinput" "$jqfilter" "quincy" || return 1 + jqfilter='.features.quorum_mon[]|select(. == "reef")' + jq_success "$jqinput" "$jqfilter" "reef" || return 1 # monmap must have no persistent features set, because we # don't currently have a quorum made out of all the monitors @@ -212,7 +215,7 @@ function TEST_mon_features() { # validate 'mon feature ls' jqinput="$(ceph mon feature ls --format=json 2>/dev/null)" - # k l m n o p are supported + # k l m n o p q are supported jqfilter='.all.supported[] | select(. == "kraken")' jq_success "$jqinput" "$jqfilter" "kraken" || return 1 jqfilter='.all.supported[] | select(. == "luminous")' @@ -227,6 +230,8 @@ function TEST_mon_features() { jq_success "$jqinput" "$jqfilter" "pacific" || return 1 jqfilter='.all.supported[] | select(. == "quincy")' jq_success "$jqinput" "$jqfilter" "quincy" || return 1 + jqfilter='.all.supported[] | select(. == "reef")' + jq_success "$jqinput" "$jqfilter" "reef" || return 1 # start third monitor run_mon $dir c --public-addr $MONC || return 1 @@ -265,6 +270,8 @@ function TEST_mon_features() { jq_success "$jqinput" "$jqfilter" || return 1 jqfilter='.monmap.features.persistent[]|select(. == "quincy")' jq_success "$jqinput" "$jqfilter" "quincy" || return 1 + jqfilter='.monmap.features.persistent[]|select(. == "reef")' + jq_success "$jqinput" "$jqfilter" "reef" || return 1 CEPH_ARGS=$CEPH_ARGS_orig # that's all folks. thank you for tuning in. diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index b545e08facb..7ee0c1d9045 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -1520,10 +1520,10 @@ function test_mon_osd() expect_false ceph osd set $f expect_false ceph osd unset $f done - ceph osd require-osd-release quincy + ceph osd require-osd-release reef # can't lower + expect_false ceph osd require-osd-release quincy expect_false ceph osd require-osd-release pacific - expect_false ceph osd require-osd-release octopus # these are no-ops but should succeed. ceph osd set noup diff --git a/src/common/options/global.yaml.in b/src/common/options/global.yaml.in index 00eb445acda..ea3c1f4fdb7 100644 --- a/src/common/options/global.yaml.in +++ b/src/common/options/global.yaml.in @@ -1959,19 +1959,19 @@ options: see_also: - mon_debug_dump_transactions with_legacy: true -- name: mon_debug_no_require_pacific +- name: mon_debug_no_require_quincy type: bool level: dev - desc: do not set pacific feature for new mon clusters + desc: do not set quincy feature for new mon clusters default: false services: - mon flags: - cluster_create -- name: mon_debug_no_require_quincy +- name: mon_debug_no_require_reef type: bool level: dev - desc: do not set quincy feature for new mon clusters + desc: do not set reef feature for new mon clusters default: false services: - mon diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index b4465a9893e..2de6baf27a4 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -851,7 +851,7 @@ COMMAND("osd unset " "notieragent|nosnaptrim", "unset ", "osd", "rw") COMMAND("osd require-osd-release "\ - "name=release,type=CephChoices,strings=octopus|pacific|quincy " + "name=release,type=CephChoices,strings=octopus|pacific|quincy|reef " "name=yes_i_really_mean_it,type=CephBool,req=false", "set the minimum allowed OSD release to participate in the cluster", "osd", "rw") diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 51df33d0a57..ece26cd54f0 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -674,16 +674,16 @@ void OSDMonitor::create_initial() if (newmap.nearfull_ratio > 1.0) newmap.nearfull_ratio /= 100; // new cluster should require latest by default - if (g_conf().get_val("mon_debug_no_require_quincy")) { - if (g_conf().get_val("mon_debug_no_require_pacific")) { - derr << __func__ << " mon_debug_no_require_quincy and pacific=true" << dendl; - newmap.require_osd_release = ceph_release_t::nautilus; - } else { - derr << __func__ << " mon_debug_no_require_quincy=true" << dendl; + if (g_conf().get_val("mon_debug_no_require_reef")) { + if (g_conf().get_val("mon_debug_no_require_quincy")) { + derr << __func__ << " mon_debug_no_require_reef and quincy=true" << dendl; newmap.require_osd_release = ceph_release_t::pacific; + } else { + derr << __func__ << " mon_debug_no_require_reef=true" << dendl; + newmap.require_osd_release = ceph_release_t::quincy; } } else { - newmap.require_osd_release = ceph_release_t::quincy; + newmap.require_osd_release = ceph_release_t::reef; } ceph_release_t r = ceph_release_from_name(g_conf()->mon_osd_initial_require_min_compat_client); @@ -3523,21 +3523,14 @@ bool OSDMonitor::preprocess_boot(MonOpRequestRef op) ceph_assert(m->get_orig_source_inst().name.is_osd()); // lower bound of N-2 - if (!HAVE_FEATURE(m->osd_features, SERVER_OCTOPUS)) { + if (!HAVE_FEATURE(m->osd_features, SERVER_PACIFIC)) { mon.clog->info() << "disallowing boot of OSD " << m->get_orig_source_inst() - << " because the osd lacks CEPH_FEATURE_SERVER_OCTOPUS"; + << " because the osd lacks CEPH_FEATURE_SERVER_PACIFIC"; goto ignore; } // make sure osd versions do not span more than 3 releases - if (HAVE_FEATURE(m->osd_features, SERVER_PACIFIC) && - osdmap.require_osd_release < ceph_release_t::nautilus) { - mon.clog->info() << "disallowing boot of pacific+ OSD " - << m->get_orig_source_inst() - << " because require_osd_release < nautilus"; - goto ignore; - } if (HAVE_FEATURE(m->osd_features, SERVER_QUINCY) && osdmap.require_osd_release < ceph_release_t::octopus) { mon.clog->info() << "disallowing boot of quincy+ OSD " @@ -3545,6 +3538,13 @@ bool OSDMonitor::preprocess_boot(MonOpRequestRef op) << " because require_osd_release < octopus"; goto ignore; } + if (HAVE_FEATURE(m->osd_features, SERVER_REEF) && + osdmap.require_osd_release < ceph_release_t::pacific) { + mon.clog->info() << "disallowing boot of reef+ OSD " + << m->get_orig_source_inst() + << " because require_osd_release < pacific"; + goto ignore; + } if (osdmap.stretch_mode_enabled && !(m->osd_features & CEPH_FEATUREMASK_STRETCH_MODE)) { @@ -11595,27 +11595,14 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, err = 0; goto reply; } - ceph_assert(osdmap.require_osd_release >= ceph_release_t::octopus); + ceph_assert(osdmap.require_osd_release >= ceph_release_t::pacific); if (!osdmap.get_num_up_osds() && !sure) { ss << "Not advisable to continue since no OSDs are up. Pass " << "--yes-i-really-mean-it if you really wish to continue."; err = -EPERM; goto reply; } - if (rel == ceph_release_t::octopus) { - if (!mon.monmap->get_required_features().contains_all( - ceph::features::mon::FEATURE_OCTOPUS)) { - ss << "not all mons are octopus"; - err = -EPERM; - goto reply; - } - if ((!HAVE_FEATURE(osdmap.get_up_osd_features(), SERVER_OCTOPUS)) - && !sure) { - ss << "not all up OSDs have CEPH_FEATURE_SERVER_OCTOPUS feature"; - err = -EPERM; - goto reply; - } - } else if (rel == ceph_release_t::pacific) { + if (rel == ceph_release_t::pacific) { if (!mon.monmap->get_required_features().contains_all( ceph::features::mon::FEATURE_PACIFIC)) { ss << "not all mons are pacific"; @@ -11641,6 +11628,19 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, err = -EPERM; goto reply; } + } else if (rel == ceph_release_t::reef) { + if (!mon.monmap->get_required_features().contains_all( + ceph::features::mon::FEATURE_REEF)) { + ss << "not all mons are reef"; + err = -EPERM; + goto reply; + } + if ((!HAVE_FEATURE(osdmap.get_up_osd_features(), SERVER_REEF)) + && !sure) { + ss << "not all up OSDs have CEPH_FEATURE_SERVER_REEF feature"; + err = -EPERM; + goto reply; + } } else { ss << "not supported for this release"; err = -EPERM;