-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add error log to receiver and clarify bad replica error message #4394
Conversation
Signed-off-by: Ian Billett <ibillett@redhat.com>
Signed-off-by: Ian Billett <ibillett@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm (:
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this in the place where error is handled? Handling error twice (by returning and logging) is a bad smell 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... there is a risk we will handle things twice, but not a biggie! (:
Signed-off-by: Ian Billett <ibillett@redhat.com>
@@ -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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... there is a risk we will handle things twice, but not a biggie! (:
Signed-off-by: Ian Billett ibillett@redhat.com
Changes
Fixes #4305
Verification
Running the integration tests from #4362 I see the following log: