]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: drop scrub machinery to wait for last_updated_applied
authorSage Weil <sage@redhat.com>
Thu, 8 Feb 2018 14:51:23 +0000 (08:51 -0600)
committerSage Weil <sage@redhat.com>
Mon, 12 Feb 2018 20:35:27 +0000 (14:35 -0600)
This is no longer needed--queued writes are immediately readable.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/PrimaryLogPG.cc

index fe8e0e44121c1390afb009541f0355e480b625bf..16c7d1b52ad5a02f497e6c31b2bdac3cd9079139 100644 (file)
@@ -4375,12 +4375,6 @@ void PG::replica_scrub(
   }
 
   assert(msg->chunky);
-  if (last_update_applied < msg->scrub_to) {
-    dout(10) << "waiting for last_update_applied to catch up" << dendl;
-    scrubber.active_rep_scrub = op;
-    return;
-  }
-
   if (active_pushes > 0) {
     dout(10) << "waiting for active pushes to finish" << dendl;
     scrubber.active_rep_scrub = op;
@@ -4523,11 +4517,6 @@ void PG::scrub(epoch_t queued, ThreadPool::TPHandle &handle)
  *           |              |   |
  *  _________v__________    |   |
  * |                    |   |   |
- * |  WAIT_LAST_UPDATE  |   |   |
- * |____________________|   |   |
- *           |              |   |
- *  _________v__________    |   |
- * |                    |   |   |
  * |      BUILD_MAP     |   |   |
  * |____________________|   |   |
  *           |              |   |
@@ -4727,8 +4716,7 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
          }
        }
 
-        // ask replicas to wait until
-        // last_update_applied >= scrubber.subset_last_update and then scan
+        // ask replicas to scan
         scrubber.waiting_on_whom.insert(pg_whoami);
 
         // request maps from replicas
@@ -4748,29 +4736,16 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
         break;
 
       case PG::Scrubber::WAIT_PUSHES:
-        if (active_pushes == 0) {
-          scrubber.state = PG::Scrubber::WAIT_LAST_UPDATE;
-        } else {
+        if (active_pushes > 0) {
           dout(15) << "wait for pushes to apply" << dendl;
           done = true;
-        }
-        break;
-
-      case PG::Scrubber::WAIT_LAST_UPDATE:
-        if (last_update_applied < scrubber.subset_last_update) {
-          // will be requeued by op_applied
-          dout(15) << "wait for writes to flush" << dendl;
-          done = true;
          break;
        }
-
-       scrubber.state = PG::Scrubber::BUILD_MAP;
        scrubber.primary_scrubmap_pos.reset();
+       scrubber.state = PG::Scrubber::BUILD_MAP;
         break;
 
       case PG::Scrubber::BUILD_MAP:
-        assert(last_update_applied >= scrubber.subset_last_update);
-
         // build my own scrub map
        if (scrub_preempted) {
          dout(10) << __func__ << " preempted" << dendl;
@@ -4825,7 +4800,6 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
         break;
 
       case PG::Scrubber::COMPARE_MAPS:
-        assert(last_update_applied >= scrubber.subset_last_update);
         assert(scrubber.waiting_on_whom.empty());
 
         scrub_compare_maps();
@@ -5787,8 +5761,6 @@ ostream& operator<<(ostream& out, const PG& pg)
   if (pg.is_peered()) {
     if (pg.last_update_ondisk != pg.info.last_update)
       out << " luod=" << pg.last_update_ondisk;
-    if (pg.last_update_applied != pg.info.last_update)
-      out << " lua=" << pg.last_update_applied;
   }
 
   if (pg.recovery_ops_active)
index 8f75e980b21b810a1bd0fb251146f9f3c690ccbb..8a664c9607e053b380f652f3ef9faa4fed929d6f 100644 (file)
@@ -1484,7 +1484,6 @@ public:
       INACTIVE,
       NEW_CHUNK,
       WAIT_PUSHES,
-      WAIT_LAST_UPDATE,
       BUILD_MAP,
       BUILD_MAP_DONE,
       WAIT_REPLICAS,
@@ -1521,7 +1520,6 @@ public:
         case INACTIVE: ret = "INACTIVE"; break;
         case NEW_CHUNK: ret = "NEW_CHUNK"; break;
         case WAIT_PUSHES: ret = "WAIT_PUSHES"; break;
-        case WAIT_LAST_UPDATE: ret = "WAIT_LAST_UPDATE"; break;
         case BUILD_MAP: ret = "BUILD_MAP"; break;
         case BUILD_MAP_DONE: ret = "BUILD_MAP_DONE"; break;
         case WAIT_REPLICAS: ret = "WAIT_REPLICAS"; break;
index b6a96724efcf417c642d08e437c16523e7d1d74c..09bfafc3fbdc5abf48e3c2baf9eb4da5e464c898 100644 (file)
@@ -9918,31 +9918,6 @@ void PrimaryLogPG::op_applied(const eversion_t &applied_version)
   dout(10) << "op_applied version " << applied_version << dendl;
   assert(applied_version == info.last_update);
   last_update_applied = applied_version;
-  if (is_primary()) {
-    if (scrubber.active) {
-      if (last_update_applied >= scrubber.subset_last_update) {
-       requeue_scrub(ops_blocked_by_scrub());
-      }
-    } else {
-      assert(scrubber.start == scrubber.end);
-    }
-  } else {
-    if (scrubber.active_rep_scrub) {
-      if (last_update_applied >= static_cast<const MOSDRepScrub*>(
-           scrubber.active_rep_scrub->get_req())->scrub_to) {
-       auto& op = scrubber.active_rep_scrub;
-       osd->enqueue_back(
-          OpQueueItem(
-           unique_ptr<OpQueueItem::OpQueueable>(new PGOpItem(info.pgid, op)),
-           op->get_req()->get_cost(),
-           op->get_req()->get_priority(),
-           op->get_req()->get_recv_stamp(),
-           op->get_req()->get_source().num(),
-           get_osdmap()->get_epoch()));
-       scrubber.active_rep_scrub = OpRequestRef();
-      }
-    }
-  }
 }
 
 void PrimaryLogPG::eval_repop(RepGather *repop)
@@ -12856,11 +12831,7 @@ void PrimaryLogPG::update_range(
   if (bi->version < info.log_tail) {
     dout(10) << __func__<< ": bi is old, rescanning local backfill_info"
             << dendl;
-    if (last_update_applied >= info.log_tail) {
-      bi->version = last_update_applied;
-    } else {
-      bi->version = info.last_update;
-    }
+    bi->version = info.last_update;
     scan_range(local_min, local_max, bi, handle);
   }