From f1597d785b7f33dc3912faa6b993198bd68eae1b Mon Sep 17 00:00:00 2001 From: Ian Billett Date: Thu, 1 Jul 2021 11:13:17 +0100 Subject: [PATCH 1/5] add error log to handleRequest unhappy path Signed-off-by: Ian Billett --- pkg/receive/handler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/receive/handler.go b/pkg/receive/handler.go index 178cd0b969..8bba929432 100644 --- a/pkg/receive/handler.go +++ b/pkg/receive/handler.go @@ -61,7 +61,7 @@ var ( // errConflict is returned whenever an operation fails due to any conflict-type error. errConflict = errors.New("conflict") - errBadReplica = errors.New("replica count exceeds replication factor") + errBadReplica = errors.New("request replica exceeds receiver replication factor") errNotReady = errors.New("target not ready") errUnavailable = errors.New("target not available") ) @@ -258,6 +258,8 @@ type replica struct { func (h *Handler) handleRequest(ctx context.Context, rep uint64, tenant string, wreq *prompb.WriteRequest) error { // The replica value in the header is one-indexed, thus we need >. if rep > h.options.ReplicationFactor { + level.Error(h.logger).Log("err", errBadReplica, "msg", "write request rejected", + "request_replica", rep, "replication_factor", h.options.ReplicationFactor) return errBadReplica } From d50408703228f9a92f928f8142039107f5a94f66 Mon Sep 17 00:00:00 2001 From: Ian Billett Date: Thu, 1 Jul 2021 11:20:35 +0100 Subject: [PATCH 2/5] add CHANGELOG Signed-off-by: Ian Billett --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3aa8ab0f5..569b5ea1fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re ### Added +- [#4394](https://github.com/thanos-io/thanos/pull/4394) Add error logs to receiver when write request rejected with invalid replica - [#4384](https://github.com/thanos-io/thanos/pull/4384) Fix the experimental PromQL editor when used on multiple line. - [#4299](https://github.com/thanos-io/thanos/pull/4299) Tracing: Add tracing to exemplar APIs. - [#4327](https://github.com/thanos-io/thanos/pull/4327) Add environment variable substitution to all YAML configuration flags. From 99ca6a108c1bc88f393126b2c224f4ce1402e18b Mon Sep 17 00:00:00 2001 From: Ian Billett Date: Thu, 1 Jul 2021 11:46:57 +0100 Subject: [PATCH 3/5] retest Signed-off-by: Ian Billett From 67fa4528c1db8d343a8736d3673566b92fe92f89 Mon Sep 17 00:00:00 2001 From: Ian Billett Date: Thu, 1 Jul 2021 12:00:12 +0100 Subject: [PATCH 4/5] retest Signed-off-by: Ian Billett From d98d07652065fbe46c74272c14111edfd5781cd6 Mon Sep 17 00:00:00 2001 From: Ian Billett Date: Fri, 2 Jul 2021 15:32:16 +0100 Subject: [PATCH 5/5] third time is a charm Signed-off-by: Ian Billett