From a9bb4bcc7be036f6c7ed9049318d29272a67e134 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 14 Jul 2021 12:15:15 -0400 Subject: [PATCH] mon/LogMonitor: tolerate external_log_to in the future This can be fast-forwarded by a sync_force or other mon thrashing events. In any case, if we see it in the future, it is easy to rewind. Signed-off-by: Sage Weil --- src/mon/LogMonitor.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mon/LogMonitor.cc b/src/mon/LogMonitor.cc index 33f3e9d07fcd..96d0a6181db5 100644 --- a/src/mon/LogMonitor.cc +++ b/src/mon/LogMonitor.cc @@ -454,7 +454,11 @@ void LogMonitor::log_external_backlog() } } // we may have logged ahead of summary.version, but never ahead of paxos - assert(external_log_to <= get_last_committed()); + if (external_log_to > get_last_committed()) { + derr << __func__ << " rewinding external_log_to from " << external_log_to + << " -> " << get_last_committed() << " (sync_force? mon rebuild?)" << dendl; + external_log_to = get_last_committed(); + } if (external_log_to >= summary.version) { return; } -- 2.47.3