From f98a6194a9a9f5794c38814c1c33d13b7fcea538 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 12 Aug 2014 07:05:34 -0700 Subject: [PATCH] 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) --- src/common/LogClient.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/LogClient.cc b/src/common/LogClient.cc index 1e290b12a23f1..e4536c7588225 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()); } -- 2.39.5