Skip to content

Commit

Permalink
mon/OSDMonitor: make pacific changes
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Apr 8, 2020
1 parent cab7e8a commit 5b3c21b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 11 deletions.
9 changes: 9 additions & 0 deletions doc/dev/release-kickoff-checklist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ Compatsets
- [x] mon/Monitor.cc (apply_monmap_to_compatset_features())
- [x] mon/Monitor.cc (calc_quorum_requirements())

Mon
---

- [x] common/options.cc define mon_debug_no_require_X
- [x] common/options.cc 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

8 changes: 4 additions & 4 deletions src/common/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2038,17 +2038,17 @@ std::vector<Option> get_global_options() {
.set_description("file to dump paxos transactions to")
.add_see_also("mon_debug_dump_transactions"),

Option("mon_debug_no_require_nautilus", Option::TYPE_BOOL, Option::LEVEL_DEV)
Option("mon_debug_no_require_octopus", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
.add_service("mon")
.set_flag(Option::FLAG_CLUSTER_CREATE)
.set_description("do not set nautilus feature for new mon clusters"),
.set_description("do not set octopus feature for new mon clusters"),

Option("mon_debug_no_require_octopus", Option::TYPE_BOOL, Option::LEVEL_DEV)
Option("mon_debug_no_require_pacific", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
.add_service("mon")
.set_flag(Option::FLAG_CLUSTER_CREATE)
.set_description("do not set octopus feature for new mon clusters"),
.set_description("do not set pacific feature for new mon clusters"),

Option("mon_debug_no_require_bluestore_for_ec_overwrites", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
Expand Down
37 changes: 30 additions & 7 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -647,16 +647,19 @@ 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<bool>("mon_debug_no_require_octopus")) {
if (g_conf().get_val<bool>("mon_debug_no_require_nautilus")) {
derr << __func__ << " mon_debug_no_require_octopus and nautilus=true" << dendl;
newmap.require_osd_release = ceph_release_t::mimic;
} else {
derr << __func__ << " mon_debug_no_require_octopus=true" << dendl;
if (g_conf().get_val<bool>("mon_debug_no_require_pacific")) {
if (g_conf().get_val<bool>("mon_debug_no_require_octopus")) {
derr << __func__ << " mon_debug_no_require_pacific and octopus=true" << dendl;
newmap.require_osd_release = ceph_release_t::nautilus;
} else {
derr << __func__ << " mon_debug_no_require_pacific=true" << dendl;
newmap.require_osd_release = ceph_release_t::octopus;
}
} else {
newmap.require_osd_release = ceph_release_t::octopus;
newmap.require_osd_release = ceph_release_t::pacific;
}

if (newmap.require_osd_release >= ceph_release_t::octopus) {
ceph_release_t r = ceph_release_from_name(
g_conf()->mon_osd_initial_require_min_compat_client);
if (!r) {
Expand Down Expand Up @@ -3397,6 +3400,13 @@ bool OSDMonitor::preprocess_boot(MonOpRequestRef op)
<< " because require_osd_release < mimic";
goto ignore;
}
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;
}

// The release check here is required because for OSD_PGLOG_HARDLIMIT,
// we are reusing a jewel feature bit that was retired in luminous.
Expand Down Expand Up @@ -11228,6 +11238,19 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
err = -EPERM;
goto reply;
}
} else 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";
err = -EPERM;
goto reply;
}
if ((!HAVE_FEATURE(osdmap.get_up_osd_features(), SERVER_PACIFIC))
&& !sure) {
ss << "not all up OSDs have CEPH_FEATURE_SERVER_PACIFIC feature";
err = -EPERM;
goto reply;
}
} else {
ss << "not supported for this release yet";
err = -EPERM;
Expand Down

0 comments on commit 5b3c21b

Please sign in to comment.