From: Aishwarya Mathuria Date: Thu, 8 Jan 2026 11:09:58 +0000 (+0000) Subject: crimson/osd/pg: modify stop() function X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e7cf68899f6f98592eb25cf313319a50ff1a4bf3;p=ceph.git crimson/osd/pg: modify stop() function This function ensures that when a PG is being removed or merged and it calls stop() - it will clear primary state, and notify the Monitor to clear any pending merge flags. It will also call client_request_orderer.clear_and_cancel() ensuring all remaining client requests are properly completed. This is needed for merging in particular since on_change() is never called for the merge epoch (handle_advance_map is skipped after merge detection), so clear_and_cancel() is never invoked on the source PG's orderer. Signed-off-by: Aishwarya Mathuria --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index d54cee09ae2..09919ab05f7 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -1683,20 +1683,26 @@ seastar::future<> PG::stop() { logger().info("PG {} {}", pgid, __func__); stopping = true; + + context_registry_on_change(); + clear_primary_state(); + if (is_primary()) { + clear_ready_to_merge(); + } + cancel_local_background_io_reservation(); cancel_remote_recovery_reservation(); check_readable_timer.cancel(); renew_lease_timer.cancel(); backend->on_actingset_changed(false); - return osdmap_gate.stop().then([this] { - return wait_for_active_blocker.stop(); - }).then([this] { - return recovery_handler->stop(); - }).then([this] { - return recovery_backend->stop(); - }).then([this] { - return backend->stop(); - }); + + co_await merge_notify_gate.close(); + co_await osdmap_gate.stop(); + co_await wait_for_active_blocker.stop(); + client_request_orderer.clear_and_cancel(*this); + co_await recovery_handler->stop(); + co_await recovery_backend->stop(); + co_await backend->stop(); } void PG::on_change(ceph::os::Transaction &t) {