From 8f74c010c1ca453cf2c8d856bc484986d927dc17 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 16 Dec 2021 16:45:00 +0000 Subject: [PATCH] crimson/osd: generalize PG::old_peering_msg() to handle query_epoch. Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/pg.cc | 12 +++++++----- src/crimson/osd/pg.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 8ad1198e099cd..fdc496e46b4fe 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -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() diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index 0bf2e0c686fb7..1115732649d64 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -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 bool can_discard_replica_op(const MsgType& m) const { -- 2.39.5