]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
src/mon/OSDMonitor.cc: more descriptive loggings for crc mismatch
authorKamoltat <ksirivad@redhat.com>
Wed, 13 Dec 2023 16:59:16 +0000 (16:59 +0000)
committerKamoltat <ksirivad@redhat.com>
Wed, 13 Dec 2023 16:59:16 +0000 (16:59 +0000)
Problem:
When mons are running different versions, e.g.,
during upgrades, we sometimes will encounter a crc
mismatch between the crc that is generated
from the leader MON (version n+1) and
the peon MON (version). Which will
later then gets resolved when all the MONs
are at version n+1.

Solution:
Provide a more informative loggings when
we encounter a CRC mismatch and also
output the mon versions so it's easier
for us to detect which if the crc mismatch
comes from OSDMap running mixed versions or
not.

Fixes: https://tracker.ceph.com/issues/63389
Signed-off-by: Kamoltat <ksirivad@redhat.com>
src/mon/OSDMonitor.cc

index 79fff068c332dec435ecfea7258a3e3742fe040a..8deaba4f91070e3373117776ca63c493acc01e2e 100644 (file)
@@ -847,6 +847,7 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
 
     bufferlist orig_full_bl;
     get_version_full(osdmap.epoch, orig_full_bl);
+    dout(20) << __func__ << " mon is running version: " << ceph_version_to_str() << dendl;
     if (orig_full_bl.length()) {
       // the primary provided the full map
       ceph_assert(inc.have_crc);
@@ -857,8 +858,12 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
        // sync with the primary for this and all future maps.  OSDs
        // will also be brought back into sync when they discover the
        // crc mismatch and request a full map from a mon.
-       derr << __func__ << " full map CRC mismatch, resetting to canonical"
-            << dendl;
+       derr << __func__ << " full map CRC mismatch,"
+    << " might be because mons are running mixed versions ..."
+    << " resetting to canonical" << dendl;
+
+  dout(20) << __func__ << " canonical crc: " << inc.full_crc
+    << " my crc: " << osdmap.crc << dendl;
 
        dout(20) << __func__ << " my (bad) full osdmap:\n";
        JSONFormatter jf(true);
@@ -2024,6 +2029,8 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   bufferlist bl;
   encode(pending_inc, bl, features | CEPH_FEATURE_RESERVED);
 
+  dout(20) << __func__ << " mon is running version: "
+    << ceph_version_to_str() << dendl;
   dout(20) << " full_crc " << tmp.get_crc()
           << " inc_crc " << pending_inc.inc_crc << dendl;