From: Sage Weil Date: Sat, 15 Sep 2018 19:40:18 +0000 (-0500) Subject: osd/PG: only signal ready_to_merge if we have all replicas X-Git-Tag: v14.0.1~212^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b945583ef1ff04283a1424e6951c3119d8b235d;p=ceph.git osd/PG: only signal ready_to_merge if we have all replicas Only signal we are ready to merge if all replicas are in good shape. If they aren't, do nothing (yet). Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 34ebff9e5886a..b04b0cfa5a96d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2345,16 +2345,20 @@ void PG::try_mark_clean() if (is_active()) { kick_snap_trim(); } else if (is_peered()) { - bool target; - if (pool.info.is_pending_merge(info.pgid.pgid, &target)) { - if (target) { - ldout(cct, 10) << "ready to merge (target)" << dendl; - osd->set_ready_to_merge_target(this, - info.history.last_epoch_clean); - } else { - ldout(cct, 10) << "ready to merge (source)" << dendl; - osd->set_ready_to_merge_source(this); + if (is_clean()) { + bool target; + if (pool.info.is_pending_merge(info.pgid.pgid, &target)) { + if (target) { + ldout(cct, 10) << "ready to merge (target)" << dendl; + osd->set_ready_to_merge_target(this, + info.history.last_epoch_clean); + } else { + ldout(cct, 10) << "ready to merge (source)" << dendl; + osd->set_ready_to_merge_source(this); + } } + } else { +#warning we should back off the merge! } }