Bug #11034 ยป ceph-gom-prefix.patch
src/os/GenericObjectMap.cc | ||
---|---|---|
void GenericObjectMap::clear_header(Header header, KeyValueDB::Transaction t)
|
||
{
|
||
dout(20) << __func__ << " clearing seq " << header->seq << dendl;
|
||
t->rmkeys_by_prefix(user_prefix(header, string()));
|
||
// delete all prefixes starting with user prefix
|
||
ceph::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl> it = db->get_iterator();
|
||
const string prefix_prefix = user_prefix(header, string());
|
||
string cur_prefix = prefix_prefix;
|
||
for (string cur_prefix = prefix_prefix;
|
||
cur_prefix.compare(0, prefix_prefix.length(), prefix_prefix) == 0;) {
|
||
t->rmkeys_by_prefix(cur_prefix);
|
||
it->seek_to_last(cur_prefix);
|
||
it->next();
|
||
if (!it->valid())
|
||
break;
|
||
cur_prefix = it->raw_key().first;
|
||
}
|
||
t->rmkeys_by_prefix(complete_prefix(header));
|
||
set<string> keys;
|
||
keys.insert(PARENT_KEY);
|