diff options
author | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-04-24 16:42:11 +0100 |
---|---|---|
committer | Joao Eduardo Luis <joao.luis@inktank.com> | 2013-04-24 16:42:11 +0100 |
commit | 54d82ec4ef8a2c0f9982c66fbb29e93c1a6b2c6c (patch) | |
tree | 59238755918f6d9bb710f09212b9f804a8b9ff84 | |
parent | b2df5c235a8928cbfeca9cba42d0036dab55dad4 (diff) | |
download | ceph-54d82ec4ef8a2c0f9982c66fbb29e93c1a6b2c6c.tar.gz |
mon: MonitorDBStore: use get() on exists() instead of lower_bound()wip-4521
This works around an issue with leveldb.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r-- | src/mon/MonitorDBStore.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h index 100762423e3..9950ec87ca5 100644 --- a/src/mon/MonitorDBStore.h +++ b/src/mon/MonitorDBStore.h @@ -406,12 +406,18 @@ class MonitorDBStore } virtual bool exists(const string& prefix, const string& key) { + bufferlist bl; + int err = get(prefix, key, bl); + return err >= 0; + + /* KeyValueDB::Iterator it = db->get_iterator(prefix); int err = it->lower_bound(key); if (err < 0) return false; return (it->valid() && it->key() == key); + */ } virtual bool exists(const string& prefix, version_t ver) { |