diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index ecb6687d9fd75..1ad5f539b5836 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -1081,6 +1081,8 @@ function test_mon_osd() ceph osd set sortbitwise # new backends cant handle nibblewise expect_false ceph osd set bogus expect_false ceph osd unset bogus + ceph osd set require_jewel_osds + expect_false ceph osd unset require_jewel_osds ceph osd set noup ceph osd down 0 diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index b3d8e14b905ed..5d2604a34c4d5 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -628,7 +628,7 @@ COMMAND("osd erasure-code-profile ls", \ "list all erasure code profiles", \ "osd", "r", "cli,rest") COMMAND("osd set " \ - "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise", \ + "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise|require_jewel_osds", \ "set ", "osd", "rw", "cli,rest") COMMAND("osd unset " \ "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise", \ diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 27c994d707934..d4408edd2eb8a 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1203,13 +1203,24 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) } } + // features for osdmap and its incremental + uint64_t features = mon->quorum_features; + // encode full map and determine its crc OSDMap tmp; { tmp.deepish_copy_from(osdmap); tmp.apply_incremental(pending_inc); + + // determine appropriate features + if (!tmp.test_flag(CEPH_OSDMAP_REQUIRE_JEWEL)) { + dout(10) << __func__ << " encoding without feature SERVER_JEWEL" << dendl; + features &= ~CEPH_FEATURE_SERVER_JEWEL; + } + dout(10) << __func__ << " encoding full map with " << features << dendl; + bufferlist fullbl; - ::encode(tmp, fullbl, mon->quorum_features | CEPH_FEATURE_RESERVED); + ::encode(tmp, fullbl, features | CEPH_FEATURE_RESERVED); pending_inc.full_crc = tmp.get_crc(); // include full map in the txn. note that old monitors will @@ -1220,7 +1231,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) // encode assert(get_last_committed() + 1 == pending_inc.epoch); - ::encode(pending_inc, bl, mon->quorum_features | CEPH_FEATURE_RESERVED); + ::encode(pending_inc, bl, features | CEPH_FEATURE_RESERVED); dout(20) << " full_crc " << tmp.get_crc() << " inc_crc " << pending_inc.inc_crc << dendl; @@ -3048,6 +3059,17 @@ void OSDMonitor::get_health(list >& summary, } } + // warn about upgrade flags that can be set but are not. + if ((osdmap.get_up_osd_features() & CEPH_FEATURE_SERVER_JEWEL) && + !osdmap.test_flag(CEPH_OSDMAP_REQUIRE_JEWEL)) { + string msg = "all OSDs are running jewel or later but the" + " 'require_jewel_osds' osdmap flag is not set"; + summary.push_back(make_pair(HEALTH_WARN, msg)); + if (detail) { + detail->push_back(make_pair(HEALTH_WARN, msg)); + } + } + get_pools_health(summary, detail); } } diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 7961d2f96771a..45dc6d47e4efb 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -2385,6 +2385,8 @@ string OSDMap::get_flag_string(unsigned f) s += ",notieragent"; if (f & CEPH_OSDMAP_SORTBITWISE) s += ",sortbitwise"; + if (f & CEPH_OSDMAP_REQUIRE_JEWEL) + s += ",require_jewel_osds"; if (s.length()) s.erase(0, 1); return s;