]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: generalize PG::old_peering_msg() to handle query_epoch.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 16 Dec 2021 16:45:00 +0000 (16:45 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 16 Dec 2021 16:47:57 +0000 (16:47 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/pg.cc
src/crimson/osd/pg.h

index 8ad1198e099cd439b2ac151b8a3a0f7c8c0809e6..fdc496e46b4fee2d36b4d3ff17243e07f65ff833 100644 (file)
@@ -1116,12 +1116,14 @@ void PG::handle_rep_op_reply(crimson::net::ConnectionRef conn,
   }
 }
 
-bool PG::old_peering_msg(const epoch_t map_epoch) const
+bool PG::old_peering_msg(
+  const epoch_t reply_epoch,
+  const epoch_t query_epoch) const
 {
   if (const epoch_t lpr = peering_state.get_last_peering_reset();
-      lpr > map_epoch) {
-    logger().debug("{}: pg changed {} after {}, dropping",
-                   __func__, get_info().history, map_epoch);
+      lpr > reply_epoch || lpr > query_epoch) {
+    logger().debug("{}: pg changed {} lpr {}, reply_epoch {}, query_epoch {}",
+                   __func__, get_info().history, lpr, reply_epoch, query_epoch);
     return true;
   }
   return false;
@@ -1150,7 +1152,7 @@ bool PG::can_discard_replica_op(const Message& m, epoch_t m_map_epoch) const
   }
   // same pg?
   //  if pg changes *at all*, we reset and repeer!
-  return old_peering_msg(m_map_epoch);
+  return old_peering_msg(m_map_epoch, m_map_epoch);
 }
 
 seastar::future<> PG::stop()
index 0bf2e0c686fb7b13a3400dcf36b5688e95c4aea1..1115732649d6418d5fa1b9f40c13063b2ecb9381 100644 (file)
@@ -707,7 +707,7 @@ public:
     return seastar::now();
   }
 
-  bool old_peering_msg(epoch_t map_epoch) const;
+  bool old_peering_msg(epoch_t reply_epoch, epoch_t query_epoch) const;
 
   template <typename MsgType>
   bool can_discard_replica_op(const MsgType& m) const {