]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: wire-up BackfillState and pg scanning on primary.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 5 May 2020 14:39:56 +0000 (16:39 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 13 Jul 2020 14:23:57 +0000 (16:23 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/backfill_state.h
src/crimson/osd/pg_recovery.cc

index 50a72342dcbfc7f0535b14946e9e9883c3d680b5..fea0f4ba93052fe7835da3565e5375db0020c249 100644 (file)
@@ -28,6 +28,9 @@ struct BackfillState {
   // events comes first
   struct PrimaryScanned : sc::event<PrimaryScanned> {
     BackfillInterval result;
+    PrimaryScanned(BackfillInterval&& result)
+      : result(std::move(result)) {
+    }
   };
 
   struct ReplicaScanned : sc::event<ReplicaScanned> {
index a585e466a30321b0269c11c647c3d518905d05cc..c5670ed35371920813daa81ce8839ee7f1a8e413 100644 (file)
@@ -423,7 +423,17 @@ void PGRecovery::request_replica_scan(
 void PGRecovery::request_primary_scan(
   const hobject_t& begin)
 {
-  ceph_abort_msg("Not implemented");
+  logger().debug("{}", __func__);
+  using crimson::common::local_conf;
+  std::ignore = pg->get_recovery_backend()->scan_for_backfill(
+    begin,
+    local_conf()->osd_backfill_scan_min,
+    local_conf()->osd_backfill_scan_max
+  ).then([this] (BackfillInterval bi) {
+    logger().debug("request_primary_scan:{}", __func__);
+    using BackfillState = crimson::osd::BackfillState;
+    start_backfill_recovery(BackfillState::PrimaryScanned{ std::move(bi) });
+  });
 }
 
 void PGRecovery::enqueue_push(