Collection is a special object in KeyValueStore, if exists collection modify,
this object will be hold. When exists check collection, it will be dead lock to
try to access this object.
Now lookup transaction cache first to ensure no collection object exists
already.
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
int KeyValueStore::BufferTransaction::check_coll(const coll_t &cid)
{
- int r = store->_check_coll(cid);
- if (r == 0)
- return r;
-
StripHeaderMap::iterator it = strip_headers.find(
make_pair(get_coll_for_coll(), make_ghobject_for_coll(cid)));
if (it != strip_headers.end() && !it->second.deleted) {
return 0;
}
+
+ if (store->_check_coll(cid) == 0)
+ return 0;
+
return -ENOENT;
}