From: Matan Breizman Date: Wed, 2 Nov 2022 10:40:03 +0000 (+0000) Subject: osd: Fix check_past_interval_bounds() X-Git-Tag: v18.1.0~278^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c611b362fb9cc4225f18283f74299551c2c5953;p=ceph.git osd: Fix check_past_interval_bounds() When getting the required past interval bounds we use oldest_map or current pg info (lec/ec). Before this change we set oldest_map epoch using the osd's superblock.oldest_map. The fix will use the max_oldest_map received with other peers instead since a specific osd's oldest_map can lag for a while in order to avoid large workloads. Fixes: https://tracker.ceph.com/issues/49689 Signed-off-by: Matan Breizman --- diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index a1b0a70ccd1..25b585ef6f8 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -368,6 +368,11 @@ public: return 0; } + epoch_t max_oldest_stored_osdmap() final { + // TODO + return 0; + } + void on_backfill_reserved() final { recovery_handler->on_backfill_reserved(); } diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 38cf7156545..c8bad743bd6 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1749,6 +1749,10 @@ epoch_t PG::oldest_stored_osdmap() { return osd->get_superblock().oldest_map; } +epoch_t PG::max_oldest_stored_osdmap() { + return osd->get_superblock().max_oldest_map; +} + OstreamTemp PG::get_clog_info() { return osd->clog->info(); } diff --git a/src/osd/PG.h b/src/osd/PG.h index 9e0d4ecca08..f1c07d1bc17 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -594,6 +594,7 @@ public: void clear_primary_state() override; epoch_t oldest_stored_osdmap() override; + epoch_t max_oldest_stored_osdmap() override; OstreamTemp get_clog_error() override; OstreamTemp get_clog_info() override; OstreamTemp get_clog_debug() override; diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 732508c1f3b..79b668af05e 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -930,7 +930,9 @@ static pair get_required_past_interval_bounds( void PeeringState::check_past_interval_bounds() const { - auto oldest_epoch = pl->oldest_stored_osdmap(); + // a specific OSD's oldest_map can lag for a while, therfore + // use the maximum MOSDMap.oldest_map received with peers. + auto oldest_epoch = pl->max_oldest_stored_osdmap(); auto rpib = get_required_past_interval_bounds( info, oldest_epoch); diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index e127c38aa03..fc7b4ef2231 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -422,6 +422,7 @@ public: virtual void on_active_actmap() = 0; virtual void on_active_advmap(const OSDMapRef &osdmap) = 0; virtual epoch_t oldest_stored_osdmap() = 0; + virtual epoch_t max_oldest_stored_osdmap() = 0; // ============ recovery reservation notifications ========== virtual void on_backfill_reserved() = 0;