]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: check object_contexts on flushed
authorSamuel Just <sam.just@inktank.com>
Tue, 12 Feb 2013 21:08:36 +0000 (13:08 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 20 Feb 2013 21:29:19 +0000 (13:29 -0800)
At FlushedEvt, all outstanding io should be complete and
the object_contexts map should be empty.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index 3c10230c41ac8ff4d94a21ae490a7f9fb63a7f16..09d27a6a037cdea6d2c934fde44269b0aa101275 100644 (file)
@@ -5436,6 +5436,7 @@ PG::RecoveryState::Reset::react(const FlushedEvt&)
 {
   PG *pg = context< RecoveryMachine >().pg;
   pg->flushed = true;
+  pg->on_flushed();
   pg->requeue_ops(pg->waiting_for_active);
   return discard_event();
 }
index ec3d4664a90796505c552c2303a78d69eb97c714..39bc6b5ab984ffe90d27687f2f8a5b5cc6d7582e 100644 (file)
@@ -1916,6 +1916,7 @@ public:
   virtual void on_role_change() = 0;
   virtual void on_change() = 0;
   virtual void on_activate() = 0;
+  virtual void on_flushed() = 0;
   virtual void on_shutdown() = 0;
   virtual void remove_watchers_and_notifies() = 0;
 
index 23174b937dd91848584cdf3d02928dbd914e6770..ffa1a93845ba0f5011117138256d7c4fe4436e4d 100644 (file)
@@ -6256,6 +6256,11 @@ void ReplicatedPG::on_shutdown()
   remove_watchers_and_notifies();
 }
 
+void ReplicatedPG::on_flushed()
+{
+  assert(object_contexts.empty());
+}
+
 void ReplicatedPG::on_activate()
 {
   for (unsigned i = 1; i<acting.size(); i++) {
index 79b11bd4561392bb7980e29503f2a5746dd60780..848cd1412b794f3eb733bfab1b993f3cf8d62913 100644 (file)
@@ -1108,6 +1108,7 @@ public:
   void on_role_change();
   void on_change();
   void on_activate();
+  void on_flushed();
   void on_removal();
   void on_shutdown();
 };