]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: do not trust small values in osd epoch cache
authorSage Weil <sage@redhat.com>
Thu, 12 Feb 2015 21:49:50 +0000 (13:49 -0800)
committerSage Weil <sage@redhat.com>
Thu, 12 Feb 2015 21:49:50 +0000 (13:49 -0800)
If the epoch cache says the osd has epoch 100 and the osd is asking for
epoch 200+, do not send it 100+.

Fixes: #10787
Backport: giant, firefly
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc

index a5c02d04858a9cd2f6e513e2c1eec8d5405706c5..c008e20680e8eda0ecef031e768e9d1147a9a253 100644 (file)
@@ -2118,10 +2118,13 @@ void OSDMonitor::send_incremental(PaxosServiceMessage *req, epoch_t first)
     osd = req->get_source().num();
     map<int,epoch_t>::iterator p = osd_epoch.find(osd);
     if (p != osd_epoch.end()) {
-      dout(10) << " osd." << osd << " should have epoch " << p->second << dendl;
-      first = p->second + 1;
-      if (first > osdmap.get_epoch())
-       return;
+      if (first <= p->second) {
+       dout(10) << __func__ << " osd." << osd << " should already have epoch "
+                << p->second << dendl;
+       first = p->second + 1;
+       if (first > osdmap.get_epoch())
+         return;
+      }
     }
   }