]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/Session: rename last_sent_epoch to projected_epoch
authorMatan Breizman <mbreizma@redhat.com>
Thu, 15 Jun 2023 14:40:34 +0000 (14:40 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 15 Jun 2023 14:40:34 +0000 (14:40 +0000)
We always update last_sent_epoch to reflect the highest map
we think the peer will have, whether because we are sending
the incremental or due to the map_epoch on the MOSDPing.

last_epoch_sent was a confusing name since we also update it
when an MOSDPing from the peer reflects a higher epoch.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/osd/OSD.cc
src/osd/Session.h

index 42ed712675613e65974350cb6b220a8c506b0e06..6db41bd609c0d6a0a79bbc1dc3de7674967750f5 100644 (file)
@@ -7293,27 +7293,27 @@ void OSDService::maybe_share_map(
 
   // assume the peer has the newer of the op's sent_epoch and what
   // we think we sent them.
-  session->sent_epoch_lock.lock();
-  if (peer_epoch_lb > session->last_sent_epoch) {
+  session->projected_epoch_lock.lock();
+  if (peer_epoch_lb > session->projected_epoch) {
     dout(10) << __func__ << " con " << con
             << " " << con->get_peer_addr()
-            << " map epoch " << session->last_sent_epoch
+            << " map epoch " << session->projected_epoch
             << " -> " << peer_epoch_lb << " (as per caller)" << dendl;
-    session->last_sent_epoch = peer_epoch_lb;
+    session->projected_epoch = peer_epoch_lb;
   }
 
-  if (osdmap->get_epoch() <= session->last_sent_epoch) {
-    session->sent_epoch_lock.unlock();
+  if (osdmap->get_epoch() <= session->projected_epoch) {
+    session->projected_epoch_lock.unlock();
     return;
   }
 
-  const epoch_t send_from = session->last_sent_epoch;
+  const epoch_t send_from = session->projected_epoch;
     dout(10) << __func__ << " con " << con
             << " " << con->get_peer_addr()
-            << " map epoch " << session->last_sent_epoch
+            << " map epoch " << session->projected_epoch
             << " -> " << osdmap->get_epoch() << " (shared)" << dendl;
-  session->last_sent_epoch = osdmap->get_epoch();
-  session->sent_epoch_lock.unlock();
+  session->projected_epoch = osdmap->get_epoch();
+  session->projected_epoch_lock.unlock();
   send_incremental_map(send_from, con, osdmap);
 }
 
index a42d37bfecc092da64557e2e5575e104ecceb147..3c3eae211cf511226632d5ff2906728afb23129f 100644 (file)
@@ -137,8 +137,8 @@ struct Session : public RefCountedObject {
     ceph::make_mutex("Session::session_dispatch_lock");
   boost::intrusive::list<OpRequest> waiting_on_map;
 
-  ceph::spinlock sent_epoch_lock;
-  epoch_t last_sent_epoch = 0;
+  ceph::spinlock projected_epoch_lock;
+  epoch_t projected_epoch = 0;
 
   /// protects backoffs; orders inside Backoff::lock *and* PG::backoff_lock
   ceph::mutex backoff_lock = ceph::make_mutex("Session::backoff_lock");