From: Sage Weil Date: Thu, 21 Aug 2014 16:49:02 +0000 (-0700) Subject: mon/OSDMonitor: populate Incremental::full_crc X-Git-Tag: v0.91~55^2~2^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=33490b71828cd6168ba8053b0c4d44955251889b;p=ceph.git mon/OSDMonitor: populate Incremental::full_crc When we encode an Incremental, put in the expected crc for the resulting full OSDMap. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 8efc700c3ee7..7c6bb75623e4 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -111,6 +111,8 @@ void OSDMonitor::create_initial() // encode into pending incremental newmap.encode(pending_inc.fullmap, mon->quorum_features | CEPH_FEATURE_RESERVED); + pending_inc.full_crc = newmap.get_crc(); + dout(20) << " full crc " << pending_inc.full_crc << dendl; } void OSDMonitor::update_from_paxos(bool *need_bootstrap) @@ -643,10 +645,23 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) } } + // determine the new map's crc + OSDMap tmp; + { + tmp.deepish_copy_from(osdmap); + tmp.apply_incremental(pending_inc); + bufferlist t; + ::encode(tmp, t, mon->quorum_features | CEPH_FEATURE_RESERVED); + pending_inc.full_crc = tmp.get_crc(); + } + // encode assert(get_last_committed() + 1 == pending_inc.epoch); ::encode(pending_inc, bl, mon->quorum_features | CEPH_FEATURE_RESERVED); + dout(20) << " full_crc " << tmp.get_crc() + << " inc_crc " << pending_inc.inc_crc << dendl; + /* put everything in the transaction */ put_version(t, pending_inc.epoch, bl); put_last_committed(t, pending_inc.epoch);