]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: MonitorDBStore: make get_next_key() work properly 5361/head
authorJoao Eduardo Luis <joao@suse.de>
Mon, 7 Sep 2015 13:12:19 +0000 (14:12 +0100)
committerJoao Eduardo Luis <jecluis@gmail.com>
Wed, 9 Sep 2015 14:45:45 +0000 (15:45 +0100)
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 <joao@suse.de>
(cherry picked from commit 70d31082fd3dc8c7857994104577f1a3631c678c)

src/mon/MonitorDBStore.h

index ef46aa0dc80f5b4e8407bf32d94993def6b553cf..78022191403326b54e8ecc66664e2b15989cf369 100644 (file)
@@ -451,8 +451,10 @@ class MonitorDBStore
 
       for (; iter->valid(); iter->next()) {
         pair<string,string> r = iter->raw_key();
-        if (sync_prefixes.count(r.first) > 0)
+        if (sync_prefixes.count(r.first) > 0) {
+          iter->next();
           return r;
+        }
       }
       return pair<string,string>();
     }