From: Sage Weil Date: Tue, 12 Aug 2014 14:05:34 +0000 (-0700) Subject: common/LogClient: fix sending dup log items X-Git-Tag: v0.84~16^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2243%2Fhead;p=ceph.git common/LogClient: fix sending dup log items We need to skip even the most recently sent item in order to get to the ones we haven't sent yet. Fixes: #9080 Backport: firefly, dumpling Signed-off-by: Sage Weil --- diff --git a/src/common/LogClient.cc b/src/common/LogClient.cc index 6ecc88ac9a7..f6fd39b6358 100644 --- a/src/common/LogClient.cc +++ b/src/common/LogClient.cc @@ -125,6 +125,7 @@ bool LogClient::are_pending() Message *LogClient::_get_mon_log_message() { + assert(log_lock.is_locked()); if (log_queue.empty()) return NULL; @@ -150,7 +151,7 @@ Message *LogClient::_get_mon_log_message() assert(num_unsent <= log_queue.size()); std::deque::iterator p = log_queue.begin(); std::deque o; - while (p->seq < last_log_sent) { + while (p->seq <= last_log_sent) { ++p; assert(p != log_queue.end()); }