]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: clear PG_STATE_CLEAN when repair object 29756/head
authorZengran Zhang <zhangzengran@sangfor.com.cn>
Tue, 20 Aug 2019 07:06:09 +0000 (15:06 +0800)
committerZengran Zhang <zhangzengran@sangfor.com.cn>
Tue, 20 Aug 2019 07:19:41 +0000 (15:19 +0800)
there is a race be found, when we repair object on clean state,
we queue a DoRecovery peering event, but before the peering event
dequeue,a snaptrim event on the missing object's snap dequeue,
then we will get pass the context< SnapTrimmer >().can_trim()
and go to get the context of the missing object(snapdir)

we can avoid this by clear clean state when we found missing..

Fixes: https://tracker.ceph.com/issues/41348
Signed-off-by: Zengran Zhang <zhangzengran@sangfor.com.cn>
src/osd/PrimaryLogPG.cc

index c653d5bedf4a035d2b73af0cb02a989435c69db9..15df4191396245fbfb71d1bc5f79002c48e3e3f1 100644 (file)
@@ -14983,6 +14983,7 @@ int PrimaryLogPG::rep_repair_primary_object(const hobject_t& soid, OpContext *ct
     eio_errors_to_process = true;
     ceph_assert(is_clean());
     state_set(PG_STATE_REPAIR);
+    state_clear(PG_STATE_CLEAN);
     queue_peering_event(
         PGPeeringEventRef(
          std::make_shared<PGPeeringEvent>(