]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: do not send peers really old maps
authorSage Weil <sage@redhat.com>
Fri, 15 Feb 2019 14:43:23 +0000 (08:43 -0600)
committerSage Weil <sage@redhat.com>
Fri, 15 Feb 2019 14:44:59 +0000 (08:44 -0600)
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 <sage@redhat.com>
src/osd/OSD.cc

index c21451fbea96e230f8ce463d141e362d05e71b41..f8d605810a05f3115a5279900bf185e2ac4b9a39 100644 (file)
@@ -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);