]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg: synchronize processing of peering events and backfill 50070/head
authorXuehan Xu <xxhdx1985126@gmail.com>
Fri, 10 Feb 2023 07:36:07 +0000 (15:36 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Fri, 10 Feb 2023 07:36:07 +0000 (15:36 +0800)
events

All peering events and backfill events for the same pg has to be
processed sequentially, so use a single pipeline phase to synchronize
them.

Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/osd/osd_operations/background_recovery.cc
src/crimson/osd/osd_operations/background_recovery.h
src/crimson/osd/osd_operations/client_request_common.cc
src/crimson/osd/osd_operations/peering_event.cc
src/crimson/osd/osd_operations/peering_event.h
src/crimson/osd/pg.cc
src/crimson/osd/pg.h
src/crimson/osd/pg_recovery.h
src/crimson/osd/recovery_backend.cc

index 116a9010d1c27f5243778908e67a2ce203f7a96e..41ad87a32bf24a37a81a2caf8342f6d973b9a8da 100644 (file)
@@ -172,9 +172,9 @@ PglogBasedRecovery::do_recovery()
   });
 }
 
-BackfillRecovery::BackfillRecoveryPipeline &BackfillRecovery::bp(PG &pg)
+PGPeeringPipeline &BackfillRecovery::bp(PG &pg)
 {
-  return pg.backfill_pipeline;
+  return pg.peering_request_pg_pipeline;
 }
 
 BackfillRecovery::interruptible_future<bool>
index dbccfd22e126a7937e731c6bd699246f2218c731..4a1ea1900c65fa60d33f7c110b7aa58bac502545 100644 (file)
@@ -9,6 +9,8 @@
 #include "crimson/osd/osd_operation.h"
 #include "crimson/osd/recovery_backend.h"
 #include "crimson/common/type_helpers.h"
+#include "crimson/osd/osd_operations/peering_event.h"
+#include "crimson/osd/pg.h"
 
 namespace crimson::osd {
 class PG;
@@ -95,16 +97,6 @@ private:
 
 class BackfillRecovery final : public BackgroundRecoveryT<BackfillRecovery> {
 public:
-  class BackfillRecoveryPipeline {
-    struct Process : OrderedExclusivePhaseT<Process> {
-      static constexpr auto type_name = "BackfillRecovery::PGPipeline::process";
-    } process;
-    friend class BackfillRecovery;
-    template <class T>
-    friend class PeeringEvent;
-    friend class LocalPeeringEvent;
-    friend class RemotePeeringEvent;
-  };
 
   template <class EventT>
   BackfillRecovery(
@@ -113,18 +105,18 @@ public:
     epoch_t epoch_started,
     const EventT& evt);
 
-  static BackfillRecoveryPipeline &bp(PG &pg);
   PipelineHandle& get_handle() { return handle; }
 
   std::tuple<
     OperationThrottler::BlockingEvent,
-    BackfillRecoveryPipeline::Process::BlockingEvent
+    PGPeeringPipeline::Process::BlockingEvent
   > tracking_events;
 
 private:
   boost::intrusive_ptr<const boost::statechart::event_base> evt;
   PipelineHandle handle;
 
+  static PGPeeringPipeline &bp(PG &pg);
   interruptible_future<bool> do_recovery() override;
 };
 
index 90916e4235990f05fc2df905073f3afc59b87938..e383d24e03b0d5fc69678f3a117b6649908e7b1f 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "crimson/osd/osd_operations/client_request_common.h"
 #include "crimson/osd/pg.h"
+#include "crimson/osd/osd_operations/background_recovery.h"
 
 namespace {
   seastar::logger& logger() {
index 219cfcb453fb3d109f8332c05bb73d7868164247..b323b4a817bf29262c75b38001bb154cd8d6976a 100644 (file)
@@ -83,11 +83,6 @@ seastar::future<> PeeringEvent<T>::with_pg(
        });
     }).then_interruptible([this, pg](auto) {
       return this->template enter_stage<interruptor>(pp(*pg).process);
-    }).then_interruptible([this, pg] {
-      // TODO: likely we should synchronize also with the pg log-based
-      // recovery.
-      return this->template enter_stage<interruptor>(
-       BackfillRecovery::bp(*pg).process);
     }).then_interruptible([this, pg, &shard_services] {
       return pg->do_peering_event(evt, ctx
       ).then_interruptible([this, pg, &shard_services] {
index f403f1fbbe4c7446c1fd4bf9d4c58428b7426f8b..44442cc01eedecaad1105ec3bea976259b2d0684 100644 (file)
@@ -8,7 +8,6 @@
 
 #include "crimson/osd/osdmap_gate.h"
 #include "crimson/osd/osd_operation.h"
-#include "crimson/osd/osd_operations/background_recovery.h"
 #include "osd/osd_types.h"
 #include "osd/PGPeeringEvent.h"
 #include "osd/PeeringState.h"
@@ -22,6 +21,7 @@ namespace crimson::osd {
 class OSD;
 class ShardServices;
 class PG;
+class BackfillRecovery;
 
   class PGPeeringPipeline {
     struct AwaitMap : OrderedExclusivePhaseT<AwaitMap> {
@@ -35,6 +35,7 @@ class PG;
     friend class LocalPeeringEvent;
     friend class RemotePeeringEvent;
     friend class PGAdvanceMap;
+    friend class BackfillRecovery;
   };
 
 template <class T>
@@ -143,7 +144,6 @@ public:
     PGPeeringPipeline::AwaitMap::BlockingEvent,
     PG_OSDMapGate::OSDMapBlocker::BlockingEvent,
     PGPeeringPipeline::Process::BlockingEvent,
-    BackfillRecovery::BackfillRecoveryPipeline::Process::BlockingEvent,
     OSDPipeline::AwaitActive::BlockingEvent,
     CompletionEvent
   > tracking_events;
@@ -180,7 +180,6 @@ public:
     PGPeeringPipeline::AwaitMap::BlockingEvent,
     PG_OSDMapGate::OSDMapBlocker::BlockingEvent,
     PGPeeringPipeline::Process::BlockingEvent,
-    BackfillRecovery::BackfillRecoveryPipeline::Process::BlockingEvent,
     CompletionEvent
   > tracking_events;
 };
index d4d76d1787ecaa4ad7989a34581b6e3ee7f8ee19..a9ca03d5987fc36265ff3a3c11c1fbe7110d2f68 100644 (file)
@@ -37,6 +37,7 @@
 #include "crimson/osd/ops_executer.h"
 #include "crimson/osd/osd_operations/osdop_params.h"
 #include "crimson/osd/osd_operations/peering_event.h"
+#include "crimson/osd/osd_operations/background_recovery.h"
 #include "crimson/osd/pg_recovery.h"
 #include "crimson/osd/replicated_recovery_backend.h"
 
index a1b0a70ccd1abbd510b223748f878ce00fd94f5c..14c68440be711a7c8b392e7325ae02b272355ea2 100644 (file)
@@ -29,7 +29,6 @@
 #include "crimson/osd/osd_operations/logmissing_request_reply.h"
 #include "crimson/osd/osd_operations/peering_event.h"
 #include "crimson/osd/osd_operations/replicated_request.h"
-#include "crimson/osd/osd_operations/background_recovery.h"
 #include "crimson/osd/shard_services.h"
 #include "crimson/osd/osdmap_gate.h"
 #include "crimson/osd/pg_activation_blocker.h"
@@ -58,6 +57,7 @@ namespace crimson::os {
 
 namespace crimson::osd {
 class OpsExecuter;
+class BackfillRecovery;
 
 class PG : public boost::intrusive_ref_counter<
   PG,
@@ -748,8 +748,6 @@ private:
   }
 
 private:
-  BackfillRecovery::BackfillRecoveryPipeline backfill_pipeline;
-
   friend class IOInterruptCondition;
   struct log_update_t {
     std::set<pg_shard_t> waiting_on;
index 5d6acffa4ce2b439c6e9c9709a5f3dd80d123601..719d0ad2d34c8a08e5e7118bf9348ff661d5e703 100644 (file)
 #include "crimson/osd/pg_recovery_listener.h"
 #include "crimson/osd/scheduler/scheduler.h"
 #include "crimson/osd/shard_services.h"
+#include "crimson/osd/recovery_backend.h"
 
 #include "osd/object_state.h"
 
+namespace crimson::osd {
+class UrgentRecovery;
+}
+
 class MOSDPGBackfillRemove;
 class PGBackend;
 
index ca595a6ffaf5b18ba6e66bf87c2482e0c77a8d80..dd56cd6205e93af58f30d7a36a79a52734817156 100644 (file)
@@ -7,6 +7,7 @@
 #include "crimson/osd/recovery_backend.h"
 #include "crimson/osd/pg.h"
 #include "crimson/osd/pg_backend.h"
+#include "crimson/osd/osd_operations/background_recovery.h"
 
 #include "messages/MOSDFastDispatchOp.h"
 #include "osd/osd_types.h"