From 92c352d047c84035478e71828e32f554d9f507fc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 12 Feb 2015 13:49:50 -0800 Subject: [PATCH] mon/OSDMonitor: do not trust small values in osd epoch cache 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 (cherry picked from commit a5759e9b97107488a8508f36adf9ca1aba3fae07) --- src/mon/OSDMonitor.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 9e341d396346d..d456a2932d51d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1779,10 +1779,13 @@ void OSDMonitor::send_incremental(PaxosServiceMessage *req, epoch_t first) osd = req->get_source().num(); map::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; + } } } -- 2.39.5