From cc0dc343a483eabf4a244369dd79409fdc4f663c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 17 May 2026 18:06:04 +0800 Subject: [PATCH] crimson/osd: complete PGAdvanceMap's pg-deleted path properly When the pg has been deleted while PGAdvanceMap was queued, start() takes an early return and skips the map-advance loop. The PeeringCtx handed to the operation may already carry a transaction and queued peering messages, so returning without calling complete_rctx() would drop them. Dispatch the rctx before bailing out. Also leave the PGPeeringPipeline::process stage via handle.complete() instead of relying on the exit_handle defer's handle.exit(). The pg-deleted path is a graceful completion, not an op failure, so it should match the normal completion path; handle.exit() is documented for the failure case only. Signed-off-by: Kefu Chai --- src/crimson/osd/osd_operations/pg_advance_map.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/crimson/osd/osd_operations/pg_advance_map.cc b/src/crimson/osd/osd_operations/pg_advance_map.cc index d22e42926d85..0c58cecee74d 100644 --- a/src/crimson/osd/osd_operations/pg_advance_map.cc +++ b/src/crimson/osd/osd_operations/pg_advance_map.cc @@ -71,6 +71,9 @@ seastar::future<> PGAdvanceMap::start() // pg may have been deleted while this op was queued; see PG::do_delete_work. if (pg->is_deleted()) { DEBUG("{}: pg is deleted, skipping advance", *this); + co_await pg->complete_rctx(std::move(rctx)); + co_await handle.complete(); + exit_handle.cancel(); co_return; } -- 2.47.3