Skip to content

Commit aca2382

Browse files
authored
[PLAT-105856] re-apply conflict errors as success (#30)
2 parents e2feb0c + 1a329a2 commit aca2382

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/receive/handler.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,11 @@ func (p *peerWorker) RemoteWriteAsync(ctx context.Context, req *storepb.WriteReq
12381238

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

0 commit comments

Comments
 (0)