From 33490b71828cd6168ba8053b0c4d44955251889b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 21 Aug 2014 09:49:02 -0700 Subject: [PATCH] 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 --- src/mon/OSDMonitor.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 8efc700c3ee..7c6bb75623e 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); -- 2.47.3