]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: encode OSDMap::Incremental with same features as OSDMap
authorSage Weil <sage@redhat.com>
Fri, 21 Oct 2016 16:25:08 +0000 (12:25 -0400)
committerLoic Dachary <ldachary@redhat.com>
Fri, 4 Nov 2016 14:35:45 +0000 (15:35 +0100)
The Incremental encode stashes encode_features, which is
what we use later to reencode the updated OSDMap.  Use
the same features so that the encoding will match!

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 916ca6a0aaa32bd9c2b449e0d7fbd312c29f06e5)

src/mon/OSDMonitor.cc

index 0de3acc7c917ea370b3214e066c9f6301f18d2b9..d4408edd2eb8a14aaf242a59f26f061aacfffd5c 100644 (file)
@@ -1203,6 +1203,9 @@ 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;
   {
@@ -1210,7 +1213,6 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
     tmp.apply_incremental(pending_inc);
 
     // determine appropriate features
-    uint64_t features = mon->quorum_features;
     if (!tmp.test_flag(CEPH_OSDMAP_REQUIRE_JEWEL)) {
       dout(10) << __func__ << " encoding without feature SERVER_JEWEL" << dendl;
       features &= ~CEPH_FEATURE_SERVER_JEWEL;
@@ -1229,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;