]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/filestore: wait_for_apply on get_omap_iterator
authorSage Weil <sage@redhat.com>
Mon, 12 Feb 2018 19:45:55 +0000 (13:45 -0600)
committerSage Weil <sage@redhat.com>
Mon, 12 Feb 2018 20:35:28 +0000 (14:35 -0600)
Note that we don't need to worry about the internal get_omap_iterator
callrs (e.g., omap_rmkeyrange) because the apply thread does these
ops sequentially and in order.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/filestore/FileStore.cc
src/os/filestore/FileStore.h

index 29eb204833d3c2550d62bf3c7adb664f45d301be..a3c4557bf13c9e3bc318cca60839ce18372ef0dc 100644 (file)
@@ -5247,6 +5247,15 @@ int FileStore::omap_check_keys(CollectionHandle& ch, const ghobject_t &hoid,
   return 0;
 }
 
+ObjectMap::ObjectMapIterator FileStore::get_omap_iterator(
+  CollectionHandle& ch,
+  const ghobject_t &oid)
+{
+  auto osr = static_cast<OpSequencer*>(ch.get());
+  osr->wait_for_apply(oid);
+  return get_omap_iterator(ch->cid, oid);
+}
+
 ObjectMap::ObjectMapIterator FileStore::get_omap_iterator(const coll_t& _c,
                                                          const ghobject_t &hoid)
 {
index efe717811117211fe551c407f6e0aab61a31c64f..9aeaefa7f3c5a9994cbd70ca4b5ce65e60124241 100644 (file)
@@ -734,9 +734,7 @@ public:
   int omap_check_keys(CollectionHandle& c, const ghobject_t &oid, const set<string> &keys,
                      set<string> *out) override;
   using ObjectStore::get_omap_iterator;
-  ObjectMap::ObjectMapIterator get_omap_iterator(CollectionHandle& c, const ghobject_t &oid) override {
-    return get_omap_iterator(c->cid, oid);
-  }
+  ObjectMap::ObjectMapIterator get_omap_iterator(CollectionHandle& c, const ghobject_t &oid) override;
   ObjectMap::ObjectMapIterator get_omap_iterator(const coll_t& cid, const ghobject_t &oid);
 
   int _create_collection(const coll_t& c, int bits,