]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: check store for temp collection in have_temp_coll
authorSamuel Just <sam.just@inktank.com>
Thu, 7 Feb 2013 19:53:28 +0000 (11:53 -0800)
committerSamuel Just <sam.just@inktank.com>
Thu, 7 Feb 2013 22:27:10 +0000 (14:27 -0800)
We may not have "created" the temp collection since OSD restart
before removing the PG.  have_temp_coll must also look at the
OSD store.  Currently, the only user is pg removal, so the
extra work is acceptable.

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

index 5e543d0a18e302d0373c12d73fb195ab2a8e0993..fba6af90f23820dd77bbcde2b63cd6c82fb97e5f 100644 (file)
@@ -3490,6 +3490,11 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx)
   }
 }
 
+bool ReplicatedPG::have_temp_coll()
+{
+  return temp_created || osd->store->collection_exists(temp_coll);
+}
+
 coll_t ReplicatedPG::get_temp_coll(ObjectStore::Transaction *t)
 {
   if (temp_created)
index 2b5019f33744dec6169dd5e7a579c87c1b43b086..ae506e5507463215bd1e50a349b03904fa93a0ba 100644 (file)
@@ -1011,9 +1011,7 @@ private:
   coll_t temp_coll;
   coll_t get_temp_coll(ObjectStore::Transaction *t);
 public:
-  bool have_temp_coll() {
-    return temp_created;
-  }
+  bool have_temp_coll();
   coll_t get_temp_coll() {
     return temp_coll;
   }