]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pg: only queue for recovery if there is any objects to repair after scrubbing
authorGuang Yang <yguang@yahoo-inc.com>
Tue, 6 Oct 2015 00:55:22 +0000 (00:55 +0000)
committerGuang Yang <yguang@yahoo-inc.com>
Fri, 16 Oct 2015 20:29:48 +0000 (20:29 +0000)
Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
src/osd/PG.cc
src/osd/PG.h

index 7b695b06f53b193e22d1269136c6c45d76b9f489..e97439cd51417e904311451dd1f6bed41b7867af 100644 (file)
@@ -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(
index 3860ad88542316bb4a7e815eaaee64f40b851e79..872c81e6fbf6999849e509b74130bbf11ea39cca 100644 (file)
@@ -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);