summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-02-07 11:53:28 -0800
committerSamuel Just <sam.just@inktank.com>2013-02-07 14:27:10 -0800
commitfa47e77a13156a272fece698e677dcd4f9884a5b (patch)
tree45d7ac185124164d0eeb5d09989c6227ecea3be7
parenta18045f0f6850f702e964f4979672cb682f7c799 (diff)
downloadceph-fa47e77a13156a272fece698e677dcd4f9884a5b.tar.gz
ReplicatedPG: check store for temp collection in have_temp_coll
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>
-rw-r--r--src/osd/ReplicatedPG.cc5
-rw-r--r--src/osd/ReplicatedPG.h4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index 5e543d0a18e..fba6af90f23 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -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)
diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h
index 2b5019f3374..ae506e55074 100644
--- a/src/osd/ReplicatedPG.h
+++ b/src/osd/ReplicatedPG.h
@@ -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;
}