Skip to content

Commit

Permalink
Merge pull request #10102 from liewegas/wip-mon-nosnap
Browse files Browse the repository at this point in the history
mon/MonitorDBStore: do not use snapshot iterator; close on close

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Reviewed-by: Joao Eduardo Luis <joao@suse.de>
Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Jul 13, 2016
2 parents 898d25f + eef2862 commit fb3a34b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/mon/MonitorDBStore.h
Expand Up @@ -482,7 +482,7 @@ class MonitorDBStore
Synchronizer get_synchronizer(pair<string,string> &key,
set<string> &prefixes) {
KeyValueDB::WholeSpaceIterator iter;
iter = db->get_snapshot_iterator();
iter = db->get_iterator();

if (!key.first.empty() && !key.second.empty())
iter->upper_bound(key.first, key.second);
Expand All @@ -496,14 +496,14 @@ class MonitorDBStore

KeyValueDB::Iterator get_iterator(const string &prefix) {
assert(!prefix.empty());
KeyValueDB::Iterator iter = db->get_snapshot_iterator(prefix);
KeyValueDB::Iterator iter = db->get_iterator(prefix);
iter->seek_to_first();
return iter;
}

KeyValueDB::WholeSpaceIterator get_iterator() {
KeyValueDB::WholeSpaceIterator iter;
iter = db->get_snapshot_iterator();
iter = db->get_iterator();
iter->seek_to_first();
return iter;
}
Expand Down Expand Up @@ -662,6 +662,7 @@ class MonitorDBStore
// there should be no work queued!
io_work.stop();
is_open = false;
db.reset(NULL);
}

void compact() {
Expand Down

0 comments on commit fb3a34b

Please sign in to comment.