summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/osd/OSD.cc2
-rw-r--r--src/osd/ReplicatedPG.cc7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index faf82624825..20aef0301ec 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -6773,7 +6773,7 @@ void OSD::do_recovery(PG *pg, ThreadPool::TPHandle &handle)
{
// see how many we should try to start. note that this is a bit racy.
recovery_wq.lock();
- int max = MAX(cct->_conf->osd_recovery_max_active - recovery_ops_active,
+ int max = MIN(cct->_conf->osd_recovery_max_active - recovery_ops_active,
cct->_conf->osd_recovery_max_single_start);
if (max > 0) {
dout(10) << "do_recovery can start " << max << " (" << recovery_ops_active << "/" << cct->_conf->osd_recovery_max_active
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index 2456d176834..3cd5a7ef865 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -7293,6 +7293,13 @@ int ReplicatedPG::start_recovery_ops(
return started;
}
+ if (needs_recovery()) {
+ // this shouldn't happen!
+ // We already checked num_missing() so we must have missing replicas
+ osd->clog.error() << info.pgid << " recovery ending with missing replicas\n";
+ return started;
+ }
+
if (state_test(PG_STATE_RECOVERING)) {
state_clear(PG_STATE_RECOVERING);
if (needs_backfill()) {