From 521f095c6505bbee7570fb3c01b32436bdbf65a4 Mon Sep 17 00:00:00 2001 From: Zengran Zhang Date: Tue, 20 Aug 2019 15:06:09 +0800 Subject: [PATCH] osd: clear PG_STATE_CLEAN when repair object 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 --- src/osd/PrimaryLogPG.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index c653d5bedf4a..15df41913962 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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( -- 2.47.3