From 85aa6fa41159ad31a68d1aea7084ae95c45d3350 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 3 Nov 2016 16:55:53 -0400 Subject: [PATCH] mon/OSDMonitor: require 'sortbitwise' before 'require_jewel_osds' This forces users upgrading past jewel to first set 'sortbitwise', which in turn means that post-jewel OSDs do not need to support nibblewise sort. Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ef0d87a9be4..3095f33ce55 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -6543,14 +6543,20 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, err = -EPERM; } } else if (key == "require_jewel_osds") { - if (osdmap.get_up_osd_features() & CEPH_FEATURE_SERVER_JEWEL) { + if (!osdmap.test_flag(CEPH_OSDMAP_SORTBITWISE)) { + ss << "the sortbitwise flag must be set before require_jewel_osds"; + err = -EPERM; + } else if (osdmap.get_up_osd_features() & CEPH_FEATURE_SERVER_JEWEL) { return prepare_set_flag(op, CEPH_OSDMAP_REQUIRE_JEWEL); } else { ss << "not all up OSDs have CEPH_FEATURE_SERVER_JEWEL feature"; err = -EPERM; } } else if (key == "require_kraken_osds") { - if (osdmap.get_up_osd_features() & CEPH_FEATURE_SERVER_KRAKEN) { + if (!osdmap.test_flag(CEPH_OSDMAP_SORTBITWISE)) { + ss << "the sortbitwise flag must be set before require_kraken_osds"; + err = -EPERM; + } else if (osdmap.get_up_osd_features() & CEPH_FEATURE_SERVER_KRAKEN) { bool r = prepare_set_flag(op, CEPH_OSDMAP_REQUIRE_KRAKEN); // ensure JEWEL is also set pending_inc.new_flags |= CEPH_OSDMAP_REQUIRE_JEWEL; -- 2.47.3