From: Xuehan Xu Date: Sat, 11 May 2024 07:01:54 +0000 (+0800) Subject: crimson/osd/pg: clear PG_STATE_SNAPTRIM on interval changes X-Git-Tag: v19.1.1~242^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2c0741fcefc936947cf1d5a19b11f1e19e6bdf9f;p=ceph.git crimson/osd/pg: clear PG_STATE_SNAPTRIM on interval changes This is to avoid the scenarios in which pgs get activated before PG_STATE_SNAPTRIM of the last pg interval gets cleared Signed-off-by: Xuehan Xu (cherry picked from commit 2c216b95ece4a0ec7ad723bdd2b00efce3135b2d) --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 02630d0b732d..457c98cf402c 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -1588,6 +1588,11 @@ void PG::on_change(ceph::os::Transaction &t) { } scrubber.on_interval_change(); obc_registry.invalidate_on_interval_change(); + // snap trim events are all going to be interrupted, + // clearing PG_STATE_SNAPTRIM/PG_STATE_SNAPTRIM_ERROR here + // is save and in time. + peering_state.state_clear(PG_STATE_SNAPTRIM); + peering_state.state_clear(PG_STATE_SNAPTRIM_ERROR); } void PG::context_registry_on_change() {