From f9eee7bccd1e2e282b3133cf824efc90fd1fd22b Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Mon, 24 Apr 2023 12:55:45 +0000 Subject: [PATCH] crimson/osd/pg: PG::on_active_actmap() fix SnapTrimEvent stop condition Signed-off-by: Matan Breizman (cherry picked from commit 03ff8f206ab681eb1518e7e73d737bce40ab7a15) --- src/crimson/osd/pg.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 9400f1a2600..56bc9977833 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -453,9 +453,10 @@ void PG::on_active_actmap() { logger().debug("{}: {} snap_trimq={}", *this, __func__, snap_trimq); peering_state.state_clear(PG_STATE_SNAPTRIM_ERROR); + // loops until snap_trimq is empty or SNAPTRIM_ERROR. std::ignore = seastar::do_until( [this] { return snap_trimq.empty() - && !peering_state.state_test(PG_STATE_SNAPTRIM_ERROR); + || peering_state.state_test(PG_STATE_SNAPTRIM_ERROR); }, [this] { peering_state.state_set(PG_STATE_SNAPTRIM); -- 2.39.5