]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/heartbeat: maintain Session::projected_epoch correctly in maybe_share_osdmap 53940/head
authorSamuel Just <sjust@redhat.com>
Sat, 20 May 2023 00:34:45 +0000 (17:34 -0700)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 11 Oct 2023 11:22:38 +0000 (11:22 +0000)
Previously, we only updated projected_map to the value sent by the peer.
This patch simplifies the end by removing an unnecessary guard and
updating projected_epoch before call,ing send_incremental_map_to_osd.

Fixes: https://tracker.ceph.com/issues/61304
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 29a1deb50488b3a1c32040804296e6619d605133)

src/crimson/osd/heartbeat.cc

index bba53ef38f9b5b89125c449f1c46bbee6d7d52d8..be6f600085187134c1ca24313a895c5838efdd66 100644 (file)
@@ -326,16 +326,15 @@ seastar::future<> Heartbeat::maybe_share_osdmap(
     return seastar::now();
   }
 
-  logger().debug("{} peer {} projected_epoch is {} while osdmap is {}",
-                __func__ , from, m->map_epoch, current_osdmap_epoch);
-  if (current_osdmap_epoch > m->map_epoch) {
-    logger().debug("{} sharing osdmap epoch of {} with peer {}",
-                   __func__, current_osdmap_epoch, from);
-    // Peer's newest map is m->map_epoch. Therfore it misses
-    // the osdmaps in the range of `m->map_epoch` to `current_osdmap_epoch`.
-    return service.send_incremental_map_to_osd(from, m->map_epoch);
-  }
-  return seastar::now();
+  const epoch_t send_from = peer.get_projected_epoch();
+  logger().debug("{} sending peer {} peer maps from projected epoch {} through "
+                "local osdmap epoch {}",
+                __func__,
+                from,
+                send_from,
+                current_osdmap_epoch);
+  peer.set_projected_epoch(current_osdmap_epoch);
+  return service.send_incremental_map_to_osd(from, send_from);
 }
 
 seastar::future<> Heartbeat::handle_reply(crimson::net::ConnectionRef conn,