From 54d82ec4ef8a2c0f9982c66fbb29e93c1a6b2c6c Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Wed, 24 Apr 2013 16:42:11 +0100 Subject: mon: MonitorDBStore: use get() on exists() instead of lower_bound() This works around an issue with leveldb. Signed-off-by: Joao Eduardo Luis --- src/mon/MonitorDBStore.h | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- cgit v1.2.1