From: Guang Yang Date: Tue, 6 Oct 2015 00:55:22 +0000 (+0000) Subject: pg: only queue for recovery if there is any objects to repair after scrubbing X-Git-Tag: v10.0.0~77^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1079636a706d5038b4e63fbfb45efe9efa15ddb7;p=ceph.git pg: only queue for recovery if there is any objects to repair after scrubbing Signed-off-by: Guang Yang --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7b695b06f53b..e97439cd5141 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4151,7 +4151,7 @@ void PG::scrub_compare_maps() _scrub(authmap, missing_digest); } -void PG::scrub_process_inconsistent() +bool PG::scrub_process_inconsistent() { dout(10) << __func__ << ": checking authoritative" << dendl; bool repair = state_test(PG_STATE_REPAIR); @@ -4198,6 +4198,7 @@ void PG::scrub_process_inconsistent() } } } + return (!scrubber.authoritative.empty() && repair); } // the part that actually finalizes a scrub @@ -4210,7 +4211,7 @@ void PG::scrub_finish() // type-specific finish (can tally more errors) _scrub_finish(); - scrub_process_inconsistent(); + bool has_error = scrub_process_inconsistent(); { stringstream oss; @@ -4278,7 +4279,7 @@ void PG::scrub_finish() } - if (repair) { + if (has_error) { queue_peering_event( CephPeeringEvtRef( new CephPeeringEvt( diff --git a/src/osd/PG.h b/src/osd/PG.h index 3860ad885423..872c81e6fbf6 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1217,7 +1217,10 @@ public: void scrub(epoch_t queued, ThreadPool::TPHandle &handle); void chunky_scrub(ThreadPool::TPHandle &handle); void scrub_compare_maps(); - void scrub_process_inconsistent(); + /** + * return true if any inconsistency/missing is repaired, false otherwise + */ + bool scrub_process_inconsistent(); void scrub_finish(); void scrub_clear_state(); void _scan_snaps(ScrubMap &map);