From fa58979c2ddf2f4aa68386d04a2dddae0cf38c7a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 15 Feb 2019 08:43:23 -0600 Subject: [PATCH] osd: do not send peers really old maps We may receive a message that sat in a queue for a while with a low priority and is tagged with an older epoch. Don't send a bunch of old maps that we have already sent the peer. Signed-off-by: Sage Weil --- src/osd/OSD.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index c21451fbea9..f8d605810a0 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7062,11 +7062,15 @@ void OSD::maybe_share_map( last_sent_epoch = session->last_sent_epoch; session->sent_epoch_lock.unlock(); + // assume the peer has the newer of the op's sent_epoch and what + // we think we sent them. + epoch_t from = std::max(last_sent_epoch, op->sent_epoch); + const Message *m = op->get_req(); service.share_map( m->get_source(), m->get_connection().get(), - op->sent_epoch, + from, osdmap, session ? &last_sent_epoch : NULL); -- 2.39.5