summaryrefslogtreecommitdiffstats
path: root/src/osd/scrubber/pg_scrubber.cc
diff options
context:
space:
mode:
authorRonen Friedman <rfriedma@redhat.com>2022-03-25 11:45:47 +0100
committerRonen Friedman <rfriedma@redhat.com>2022-03-25 12:49:51 +0100
commit948d3266c67bf896d1c20472977b849178d233d3 (patch)
treebe949b92dc119812f50b5ede92af57412c551772 /src/osd/scrubber/pg_scrubber.cc
parentMerge pull request #45466 from neha-ojha/wip-54592 (diff)
downloadceph-948d3266c67bf896d1c20472977b849178d233d3.tar.xz
ceph-948d3266c67bf896d1c20472977b849178d233d3.zip
osd/scrub: restart snap trimming only after scrubbing is done
Snap trimming that was postponed as the target PG was scrubbing must be restarted at scrub completion. PR #38111 moved trimming restart to just before the scrub fully terminated. The current PR fixes that. Trimming is also restarted in those cases where scrub was queued but aborted immediately. Fixes: https://tracker.ceph.com/issues/52026 Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
Diffstat (limited to '')
-rw-r--r--src/osd/scrubber/pg_scrubber.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/osd/scrubber/pg_scrubber.cc b/src/osd/scrubber/pg_scrubber.cc
index b7f007c7385..5dcc17b8138 100644
--- a/src/osd/scrubber/pg_scrubber.cc
+++ b/src/osd/scrubber/pg_scrubber.cc
@@ -189,6 +189,8 @@ void PgScrubber::initiate_regular_scrub(epoch_t epoch_queued)
dout(10) << "scrubber event --<< StartScrub" << dendl;
} else {
clear_queued_or_active();
+ // and just in case snap trimming was blocked by the aborted scrub
+ m_pg->snap_trimmer_scrub_complete();
}
}
@@ -203,6 +205,8 @@ void PgScrubber::initiate_scrub_after_repair(epoch_t epoch_queued)
dout(10) << "scrubber event --<< AfterRepairScrub" << dendl;
} else {
clear_queued_or_active();
+ // and just in case snap trimming was blocked by the aborted scrub
+ m_pg->snap_trimmer_scrub_complete();
}
}
@@ -1793,11 +1797,6 @@ void PgScrubber::scrub_finish()
&t);
int tr = m_osds->store->queue_transaction(m_pg->ch, std::move(t), nullptr);
ceph_assert(tr == 0);
-
- if (!m_pg->snap_trimq.empty()) {
- dout(10) << "scrub finished, requeuing snap_trimmer" << dendl;
- m_pg->snap_trimmer_scrub_complete();
- }
}
if (has_error) {
@@ -1817,6 +1816,9 @@ void PgScrubber::scrub_finish()
if (m_pg->is_active() && m_pg->is_primary()) {
m_pg->recovery_state.share_pg_info();
}
+
+ // we may have blocked the snap trimmer
+ m_pg->snap_trimmer_scrub_complete();
}
void PgScrubber::on_digest_updates()