Skip to content

Commit e453ae7

Browse files
athanatosMatan-B
authored andcommitted
crimson/osd/pg_recovery: only reset_pglog_based_recovery_op if complete
ce4e9aa, as part of the start_recovery_ops changed the call to reset_pglog_based_recovery_op to occur unconditionally rather than only if recovery has completed. Note, this fix only restores the prior behavior. There's actually still a race here where a DeferRecovery could be processed between the call to reset_pglog_based_recovery_op and the RequestBackfill or AllReplicasRecovered being processed. Introduced: ce4e9aa Related: https://tracker.ceph.com/issues/71267 Fixes: https://tracker.ceph.com/issues/70337 Signed-off-by: Samuel Just <[email protected]> (cherry picked from commit c95509e)
1 parent ab8609c commit e453ae7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/crimson/osd/pg_recovery.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ PGRecovery::start_recovery_ops(
8080
ceph_assert(pg->is_recovering());
8181
ceph_assert(!pg->is_backfilling());
8282

83-
// move to unnamed placeholder when C++ 26 is available
84-
auto reset_pglog_based_recovery_op = seastar::defer([this] {
85-
pg->reset_pglog_based_recovery_op();
86-
});
87-
8883
if (!pg->get_peering_state().needs_recovery()) {
8984
if (pg->get_peering_state().needs_backfill()) {
9085
request_backfill();
9186
} else {
9287
all_replicas_recovered();
9388
}
89+
/* TODO: this is racy -- it's possible for a DeferRecovery
90+
* event to be processed between this call and when the
91+
* async RequestBackfill or AllReplicasRecovered events
92+
* are processed -- see https://tracker.ceph.com/issues/71267 */
93+
pg->reset_pglog_based_recovery_op();
9494
co_return seastar::stop_iteration::yes;
9595
}
9696
co_return seastar::stop_iteration::no;

0 commit comments

Comments
 (0)