From c025323bf45c9d8bd77324206388ea98b6b3449b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 4 May 2017 12:11:23 -0500 Subject: [PATCH] mon/OSDMonitor: set OSDMap require_min_compat_client on upgrade Fill in this field once require_luminous is set. Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a99bd88bb94..f55d5349590 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1149,13 +1149,13 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) bufferlist bl; - // set or clear full/nearfull? { OSDMap tmp; tmp.deepish_copy_from(osdmap); tmp.apply_incremental(pending_inc); if (tmp.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { + // set or clear full/nearfull? int full, backfill, nearfull; tmp.count_full_nearfull_osds(&full, &backfill, &nearfull); if (full > 0) { @@ -1181,6 +1181,16 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) } } } + + // min_compat_client? + if (tmp.require_min_compat_client.empty()) { + auto mv = tmp.get_min_compat_client(); + dout(1) << __func__ << " setting require_min_compat_client to current " << mv + << dendl; + mon->clog->info() << "setting require_min_compat_client to currently required " + << mv; + pending_inc.new_require_min_compat_client = mv.first; + } } } -- 2.39.5