]> git-server-git.apps.pok.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)
committerXuehan Xu <xuxuehan@qianxin.com>
Sat, 11 May 2024 07:09:08 +0000 (15:09 +0800)
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>
src/crimson/osd/pg.cc

index eaa72cc39a4386c995dfac915dd94512c872819e..9c91bf23858abcbd81f678161d260d71d4e50274 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() {