]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/: clean up PG deleted and deleting references
authorSamuel Just <sjust@redhat.com>
Fri, 12 Apr 2019 23:34:25 +0000 (16:34 -0700)
committersjust@redhat.com <sjust@redhat.com>
Wed, 1 May 2019 18:22:25 +0000 (11:22 -0700)
Signed-off-by: sjust@redhat.com <sjust@redhat.com>
src/crimson/common/.#log.cc [new symlink]
src/osd/PG.cc
src/osd/PG.h
src/osd/PeeringState.h
src/osd/PrimaryLogPG.cc

diff --git a/src/crimson/common/.#log.cc b/src/crimson/common/.#log.cc
new file mode 120000 (symlink)
index 0000000..d141a2a
--- /dev/null
@@ -0,0 +1 @@
+sam@pondermatic.4162:1552956455
\ No newline at end of file
index db3a22ccd5593a1f3ac14c0e2f4f74cbe6305343..48fea1c528552a8378722295ffad366ef1538ae4 100644 (file)
@@ -211,8 +211,6 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   backfill_targets(recovery_state.backfill_targets),
   async_recovery_targets(recovery_state.async_recovery_targets),
   might_have_unfound(recovery_state.might_have_unfound),
-  deleting(recovery_state.deleting),
-  deleted(recovery_state.deleted),
   missing_loc(recovery_state.missing_loc),
   pg_id(p),
   coll(p),
@@ -503,7 +501,7 @@ void PG::_finish_recovery(Context *c)
   lock();
   // When recovery is initiated by a repair, that flag is left on
   state_clear(PG_STATE_REPAIR);
-  if (deleting) {
+  if (recovery_state.is_deleting()) {
     unlock();
     return;
   }
@@ -898,6 +896,7 @@ void PG::shutdown()
 {
   ch->flush();
   lock();
+  recovery_state.shutdown();
   on_shutdown();
   unlock();
 }
@@ -4078,7 +4077,7 @@ void PG::do_delete_work(ObjectStore::Transaction *t)
       dirty_info = true;
       dirty_big_info = true;
     } else {
-      deleted = true;
+      recovery_state.set_delete_complete();
 
       // cancel reserver here, since the PG is about to get deleted and the
       // exit() methods don't run when that happens.
index 438beb5e47a536553273fc1e41cd6fbe05cc0ca5..e0023afb30fb3c34786df207f63269aa1fc723c1 100644 (file)
@@ -208,8 +208,6 @@ protected:
   set<pg_shard_t> &backfill_targets;
   set<pg_shard_t> &async_recovery_targets;
   set<pg_shard_t> &might_have_unfound;
-  bool &deleting;
-  atomic<bool> &deleted;
   MissingLoc &missing_loc;
 
 public:
index 742cb6a499f6c76210cfb3cfeb825f47ba84a562..4f6e5c0989382725fd62140c634971543d1f99c2 100644 (file)
@@ -1546,6 +1546,14 @@ public:
     last_persisted_osdmap = 0;
   }
 
+  void shutdown() {
+    deleting = true;
+  }
+
+  void set_delete_complete() {
+    deleted = true;
+  }
+
   template <typename Func>
   void adjust_purged_snaps(Func f) {
     f(info.purged_snaps);
index 7ae79317a5786b3baf35bf782e521bae9f8909ef..23c03e1af209aa8a18056d9424a817c5ccc6f27a 100644 (file)
@@ -4636,7 +4636,7 @@ void PrimaryLogPG::snap_trimmer_scrub_complete()
 
 void PrimaryLogPG::snap_trimmer(epoch_t queued)
 {
-  if (deleting || pg_has_reset_since(queued)) {
+  if (recovery_state.is_deleting() || pg_has_reset_since(queued)) {
     return;
   }
 
@@ -11593,7 +11593,7 @@ void PrimaryLogPG::_applied_recovered_object(ObjectContextRef obc)
   --active_pushes;
 
   // requeue an active chunky scrub waiting on recovery ops
-  if (!deleting && active_pushes == 0
+  if (!recovery_state.is_deleting() && active_pushes == 0
       && scrubber.is_chunky_scrub_active()) {
     requeue_scrub(ops_blocked_by_scrub());
   }
@@ -11606,7 +11606,7 @@ void PrimaryLogPG::_applied_recovered_object_replica()
   --active_pushes;
 
   // requeue an active chunky scrub waiting on recovery ops
-  if (!deleting && active_pushes == 0 &&
+  if (!recovery_state.is_deleting() && active_pushes == 0 &&
       scrubber.active_rep_scrub && static_cast<const MOSDRepScrub*>(
        scrubber.active_rep_scrub->get_req())->chunky) {
     auto& op = scrubber.active_rep_scrub;
@@ -12047,9 +12047,6 @@ void PrimaryLogPG::on_shutdown()
 {
   dout(10) << __func__ << dendl;
 
-  // handles queue races
-  deleting = true;
-
   if (recovery_queued) {
     recovery_queued = false;
     osd->clear_queued_recovery(this);
@@ -12378,7 +12375,7 @@ bool PrimaryLogPG::start_recovery_ops(
   bool recovery_started = false;
   ceph_assert(is_primary());
   ceph_assert(is_peered());
-  ceph_assert(!is_deleting());
+  ceph_assert(!recovery_state.is_deleting());
 
   ceph_assert(recovery_queued);
   recovery_queued = false;
@@ -13916,7 +13913,7 @@ bool PrimaryLogPG::agent_work(int start_max, int agent_flush_quota)
     return true;
   }
 
-  ceph_assert(!deleting);
+  ceph_assert(!recovery_state.is_deleting());
 
   if (agent_state->is_idle()) {
     dout(10) << __func__ << " idle, stopping" << dendl;