From: Sage Weil Date: Fri, 22 Aug 2014 00:35:15 +0000 (-0700) Subject: mon/OSDMonitor: verify full_crc when available X-Git-Tag: v0.91~55^2~2^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=716f90f31e7301ddd05f45fe4ab88061d11dca89;p=ceph.git mon/OSDMonitor: verify full_crc when available Crash if it is wrong. The monitors should *always* agree. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 7c6bb75623e4..180d350d9718 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -223,6 +223,16 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap) osdmap.encode(full_bl, f | CEPH_FEATURE_RESERVED); tx_size += full_bl.length(); + // verify the crc is as expected + if (inc.have_crc && + inc.full_crc != osdmap.crc) { + derr << "inc for epoch " << osdmap.get_epoch() << " has full_crc " + << inc.full_crc << " but actual is " << osdmap.crc + << " features " << f + << dendl; + assert(0 == "got mismatched crc encoding full map"); + } + put_version_full(t, osdmap.epoch, full_bl); put_version_latest_full(t, osdmap.epoch);