]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/pg: clear PG_STATE_SNAPTRIM on interval changes
authorXuehan Xu <xuxuehan@qianxin.com>
Sat, 11 May 2024 07:01:54 +0000 (15:01 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 13 Jun 2024 12:41:31 +0000 (15:41 +0300)
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 <xuxuehan@qianxin.com>
(cherry picked from commit 2c216b95ece4a0ec7ad723bdd2b00efce3135b2d)

src/crimson/osd/pg.cc

index 02630d0b732da4a042f2fd9e34eb0a7886fb334e..457c98cf402caa7da122acfb7b212a8921cb789f 100644 (file)
@@ -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() {