]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: MonitorDBStore: make get_next_key() work properly
authorJoao Eduardo Luis <joao@suse.de>
Mon, 7 Sep 2015 13:12:19 +0000 (14:12 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Mon, 7 Sep 2015 13:12:19 +0000 (14:12 +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>
src/mon/MonitorDBStore.h

index b9aab3094ef5be9e585ef3d5bb2bb4e5f1e8e572..1a6f419e515a382a753ac2bb866f4444f70405f4 100644 (file)
@@ -461,8 +461,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>();
     }