From: Joao Eduardo Luis Date: Mon, 7 Sep 2015 13:12:19 +0000 (+0100) Subject: mon: MonitorDBStore: make get_next_key() work properly X-Git-Tag: v0.94.6~106^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e8d6d5a5f43b75f6aaec4c977221ad97d11e314c;p=ceph.git mon: MonitorDBStore: make get_next_key() work properly We introduced a significant bug with 2cc7aee, when we fixed issue #11786. Although that patch would fix the problem described in #11786, we managed to not increment the iterator upon returning the current key. This would have the iterator iterating over the same key, forever and ever. Signed-off-by: Joao Eduardo Luis (cherry picked from commit 70d31082fd3dc8c7857994104577f1a3631c678c) --- diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h index ef46aa0dc80..78022191403 100644 --- a/src/mon/MonitorDBStore.h +++ b/src/mon/MonitorDBStore.h @@ -451,8 +451,10 @@ class MonitorDBStore for (; iter->valid(); iter->next()) { pair r = iter->raw_key(); - if (sync_prefixes.count(r.first) > 0) + if (sync_prefixes.count(r.first) > 0) { + iter->next(); return r; + } } return pair(); }