]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Don't evict even when preemption has restarted with smaller chunk
authorDavid Zafman <dzafman@redhat.com>
Thu, 10 May 2018 00:32:39 +0000 (17:32 -0700)
committerDavid Zafman <dzafman@redhat.com>
Wed, 16 May 2018 20:38:08 +0000 (13:38 -0700)
Fixes: https://tracker.ceph.com/issues/24045
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 818b59fa95ee60e86991276f18c4dee405dc79b1)

src/osd/PG.cc
src/osd/PG.h

index 738919e8fbfd11fd3298f3fd05697cdfb1d17aca..337a008306061fd2c7aeca39d3cd387df4b5a72e 100644 (file)
@@ -4669,6 +4669,7 @@ void PG::replica_scrub(
   scrubber.replica_scrub_start = msg->min_epoch;
   scrubber.start = msg->start;
   scrubber.end = msg->end;
+  scrubber.max_end = msg->end;
   scrubber.deep = msg->deep;
   scrubber.epoch_start = info.history.same_interval_since;
   if (msg->priority) {
@@ -4860,7 +4861,8 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
 
   while (!done) {
     dout(20) << "scrub state " << Scrubber::state_string(scrubber.state)
-            << " [" << scrubber.start << "," << scrubber.end << ")" << dendl;
+            << " [" << scrubber.start << "," << scrubber.end << ")"
+            << " max_end " << scrubber.max_end << dendl;
 
     switch (scrubber.state) {
       case PG::Scrubber::INACTIVE:
@@ -4979,6 +4981,8 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
            break;
          }
          scrubber.end = candidate_end;
+         if (scrubber.end > scrubber.max_end)
+           scrubber.max_end = scrubber.end;
         }
 
         // walk the log to find the latest update that affects our chunk
@@ -5188,6 +5192,7 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
        scrubber.replica_scrubmap_pos = ScrubMapBuilder();
        scrubber.start = hobject_t();
        scrubber.end = hobject_t();
+       scrubber.max_end = hobject_t();
        done = true;
        break;
 
@@ -5196,7 +5201,8 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
     }
   }
   dout(20) << "scrub final state " << Scrubber::state_string(scrubber.state)
-          << " [" << scrubber.start << "," << scrubber.end << ")" << dendl;
+          << " [" << scrubber.start << "," << scrubber.end << ")"
+          << " max_end " << scrubber.max_end << dendl;
 }
 
 bool PG::write_blocked_by_scrub(const hobject_t& soid)
@@ -5218,8 +5224,8 @@ bool PG::write_blocked_by_scrub(const hobject_t& soid)
 
 bool PG::range_intersects_scrub(const hobject_t &start, const hobject_t& end)
 {
-  // does [start, end] intersect [scrubber.start, scrubber.end)
-  return (start < scrubber.end &&
+  // does [start, end] intersect [scrubber.start, scrubber.max_end)
+  return (start < scrubber.max_end &&
          end >= scrubber.start);
 }
 
@@ -8153,6 +8159,7 @@ boost::statechart::result PG::RecoveryState::Active::react(const QueryState& q)
     q.f->dump_string("scrubber.state", Scrubber::state_string(pg->scrubber.state));
     q.f->dump_stream("scrubber.start") << pg->scrubber.start;
     q.f->dump_stream("scrubber.end") << pg->scrubber.end;
+    q.f->dump_stream("scrubber.max_end") << pg->scrubber.max_end;
     q.f->dump_stream("scrubber.subset_last_update") << pg->scrubber.subset_last_update;
     q.f->dump_bool("scrubber.deep", pg->scrubber.deep);
     {
index 06a500185664b134835fa341bcb10528ed83ec9f..7b4f26d25ed58dff6386c8c6479845464f4ee0da 100644 (file)
@@ -1622,6 +1622,7 @@ public:
 
     // chunky scrub
     hobject_t start, end;    // [start,end)
+    hobject_t max_end;       // Largest end that may have been sent to replicas
     eversion_t subset_last_update;
 
     // chunky scrub state
@@ -1697,6 +1698,7 @@ public:
       state = PG::Scrubber::INACTIVE;
       start = hobject_t();
       end = hobject_t();
+      max_end = hobject_t();
       subset_last_update = eversion_t();
       shallow_errors = 0;
       deep_errors = 0;