From: Samuel Just Date: Thu, 7 Feb 2013 19:53:28 +0000 (-0800) Subject: ReplicatedPG: check store for temp collection in have_temp_coll X-Git-Tag: v0.57~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fa47e77a13156a272fece698e677dcd4f9884a5b;p=ceph.git 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5e543d0a18e3..fba6af90f238 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 2b5019f33744..ae506e550746 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; }