From aabdccdfa0877848dc6bf78e416a8f07b6671ab9 Mon Sep 17 00:00:00 2001 From: Chris Piraino Date: Fri, 8 Jan 2021 14:03:06 -0600 Subject: [PATCH] Log replication warnings when no error suppression is defined (#9320) * Log replication warnings when no error suppression is defined * Add changelog file --- .changelog/9320.txt | 3 +++ agent/consul/replication.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/9320.txt diff --git a/.changelog/9320.txt b/.changelog/9320.txt new file mode 100644 index 0000000000..6c546e9cc9 --- /dev/null +++ b/.changelog/9320.txt @@ -0,0 +1,3 @@ +```release-note:bug +replication: Correctly log all replication warnings that should not be suppressed +``` diff --git a/agent/consul/replication.go b/agent/consul/replication.go index 910f18871c..eb292db59f 100644 --- a/agent/consul/replication.go +++ b/agent/consul/replication.go @@ -104,7 +104,7 @@ func (r *Replicator) Run(ctx context.Context) error { // the next round of replication atomic.StoreUint64(&r.lastRemoteIndex, 0) - if r.suppressErrorLog != nil && !r.suppressErrorLog(err) { + if r.suppressErrorLog == nil || !r.suppressErrorLog(err) { r.logger.Warn("replication error (will retry if still leader)", "error", err) }