]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: remove block_writes from scrubber
authorSamuel Just <sjust@redhat.com>
Thu, 29 Jan 2015 22:21:22 +0000 (14:21 -0800)
committerSamuel Just <sjust@redhat.com>
Thu, 29 Jan 2015 22:21:55 +0000 (14:21 -0800)
block_writes is actually redundant, it is true iff scrubber.start !=
scrubber.end.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc

index 8cc4e4eda3e75a0c362382b0352fddf65d15de69..1a93c874fb3cc9b7fb8c2814730f3dc57864422f 100644 (file)
@@ -3929,7 +3929,6 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
          }
          scrubber.end = candidate_end;
         }
-        scrubber.block_writes = true;
 
         // walk the log to find the latest update that affects our chunk
         scrubber.subset_last_update = pg_log.get_tail();
@@ -4015,7 +4014,6 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
         assert(scrubber.waiting_on == 0);
 
         scrub_compare_maps();
-        scrubber.block_writes = false;
        scrubber.run_callbacks();
 
         // requeue the writes from the chunk that just finished
@@ -6447,7 +6445,6 @@ boost::statechart::result PG::RecoveryState::Active::react(const QueryState& q)
     q.f->open_object_section("scrub");
     q.f->dump_stream("scrubber.epoch_start") << pg->scrubber.epoch_start;
     q.f->dump_int("scrubber.active", pg->scrubber.active);
-    q.f->dump_int("scrubber.block_writes", pg->scrubber.block_writes);
     q.f->dump_int("scrubber.waiting_on", pg->scrubber.waiting_on);
     {
       q.f->open_array_section("scrubber.waiting_on_whom");
index 5835c2f0382fd3f7a875f5881eb045dbc9feacc7..b806a673011d91e16413041e66abbc9c62265129 100644 (file)
@@ -1025,7 +1025,7 @@ public:
     Scrubber() :
       reserved(false), reserve_failed(false),
       epoch_start(0),
-      block_writes(false), active(false), queue_snap_trim(false),
+      active(false), queue_snap_trim(false),
       waiting_on(0), shallow_errors(0), deep_errors(0), fixed(0),
       active_rep_scrub(0),
       must_scrub(false), must_deep_scrub(false), must_repair(false),
@@ -1042,7 +1042,6 @@ public:
     epoch_t epoch_start;
 
     // common to both scrubs
-    bool block_writes;
     bool active;
     bool queue_snap_trim;
     int waiting_on;
@@ -1126,9 +1125,6 @@ public:
     // classic (non chunk) scrubs block all writes
     // chunky scrubs only block writes to a range
     bool write_blocked_by_scrub(const hobject_t &soid) {
-      if (!block_writes)
-       return false;
-
       if (soid >= start && soid < end)
        return true;
 
@@ -1137,7 +1133,6 @@ public:
 
     // clear all state
     void reset() {
-      block_writes = false;
       active = false;
       queue_snap_trim = false;
       waiting_on = 0;
index 0a54565d5babccc4158dc614a34bb800c45d6c1f..fa623ed1d944916a29b97f620d8aeeb49cee8091 100644 (file)
@@ -7290,7 +7290,7 @@ void ReplicatedPG::op_applied(const eversion_t &applied_version)
         osd->scrub_wq.queue(this);
       }
     } else {
-      assert(!scrubber.block_writes);
+      assert(scrubber.start == scrubber.end);
     }
   } else {
     if (scrubber.active_rep_scrub) {