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.67.11~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e7c5fb58d85ed0d1be359e616137666c5e207c38;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 (cherry picked from commit 057c6808be5bc61c3f1ac2b956c1522f18411245) --- diff --git a/src/common/LogClient.cc b/src/common/LogClient.cc index 1e290b12a23f..e4536c758822 100644 --- a/src/common/LogClient.cc +++ b/src/common/LogClient.cc @@ -124,6 +124,7 @@ bool LogClient::are_pending() Message *LogClient::_get_mon_log_message() { + assert(log_lock.is_locked()); if (log_queue.empty()) return NULL; @@ -149,7 +150,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()); }