Skip to content

Commit

Permalink
[PLAT-105856] re-apply conflict errors as success
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Jin <[email protected]>
  • Loading branch information
jnyi committed Apr 10, 2024
1 parent e2feb0c commit 1a329a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/receive/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,11 @@ func (p *peerWorker) RemoteWriteAsync(ctx context.Context, req *storepb.WriteReq

tracing.DoInSpan(ctx, "receive_forward", func(ctx context.Context) {
_, err := storepb.NewWriteableStoreClient(p.cc).RemoteWrite(ctx, req)
if isConflict(err) && p.wp.Size() > 1 {
// conflict errors are valid in our dual scraping setup, worker pool size > 1 to bypass unit tests
// see original PR: https://github.com/databricks/thanos/pull/27
err = nil
}
responseWriter <- newWriteResponse(
seriesIDs,
errors.Wrapf(err, "forwarding request to endpoint %v", er.endpoint),
Expand All @@ -1252,6 +1257,7 @@ func (p *peerWorker) RemoteWriteAsync(ctx context.Context, req *storepb.WriteReq
}, opentracing.Tags{
"endpoint": er.endpoint,
"replica": er.replica,
"samples": req.Size(),
})
})
}
Expand Down

0 comments on commit 1a329a2

Please sign in to comment.