From: Sage Weil Date: Sat, 22 Aug 2015 14:33:40 +0000 (-0400) Subject: os/newstore: flush object before doing omap reads X-Git-Tag: v9.1.0~242^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c37b06d0fbd7f17b12f927a30bb026345e6158b8;p=ceph.git os/newstore: flush object before doing omap reads Signed-off-by: Sage Weil --- diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index 002d4e73bd41..78764cf1fab1 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -31,6 +31,7 @@ TODO: + * collection_list must flush pending db work * multiple fragments per object (with configurable size.. maybe 1 or 2 mb default?) * read path should be totally generic (handle any fragment pattern) * write path should ideally tolerate any fragment pattern, but only generate a fixed layout (since the tunable may be changed over time). @@ -1766,6 +1767,7 @@ int NewStore::omap_get( } if (!o->onode.omap_head) goto out; + o->flush(); { KeyValueDB::Iterator it = db->get_iterator(PREFIX_OMAP); string head, tail; @@ -1814,6 +1816,7 @@ int NewStore::omap_get_header( } if (!o->onode.omap_head) goto out; + o->flush(); { string head; get_omap_header(o->onode.omap_head, &head); @@ -1847,6 +1850,7 @@ int NewStore::omap_get_keys( } if (!o->onode.omap_head) goto out; + o->flush(); { KeyValueDB::Iterator it = db->get_iterator(PREFIX_OMAP); string head, tail; @@ -1896,6 +1900,7 @@ int NewStore::omap_get_values( } if (!o->onode.omap_head) goto out; + o->flush(); for (set::const_iterator p = keys.begin(); p != keys.end(); ++p) { string key; get_omap_key(o->onode.omap_head, *p, &key); @@ -1930,6 +1935,7 @@ int NewStore::omap_check_keys( } if (!o->onode.omap_head) goto out; + o->flush(); for (set::const_iterator p = keys.begin(); p != keys.end(); ++p) { string key; get_omap_key(o->onode.omap_head, *p, &key); @@ -1964,6 +1970,7 @@ ObjectMap::ObjectMapIterator NewStore::get_omap_iterator( dout(10) << __func__ << " " << oid << "doesn't exist" <flush(); dout(10) << __func__ << " header = " << o->onode.omap_head <get_iterator(PREFIX_OMAP); return ObjectMap::ObjectMapIterator(new OmapIteratorImpl(c, o, it));