]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: set OSDMap require_min_compat_client on upgrade
authorSage Weil <sage@redhat.com>
Thu, 4 May 2017 17:11:23 +0000 (12:11 -0500)
committerSage Weil <sage@redhat.com>
Tue, 9 May 2017 16:32:55 +0000 (11:32 -0500)
Fill in this field once require_luminous is set.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc

index a99bd88bb94d3a3fadc4caf11b29be41294740f1..f55d5349590c820a9097911846d6e86eb6049445 100644 (file)
@@ -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;
+      }
     }
   }