Skip to content

Do not reuse remote write requests in case of error #5422

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

Merged
merged 2 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* [BUGFIX] Compactor: Partial block with only visit marker should be deleted even there is no deletion marker. #5342
* [BUGFIX] KV: Etcd calls will no longer block indefinitely and will now time out after the DialTimeout period. #5392
* [BUGFIX] Ring: Allow RF greater than number of zones to select more than one instance per zone #5411
* [BUGFIX] Distributor: Fix potential data corruption in cases of timeout between distributors and ingesters. #5422

## 1.15.1 2023-04-26

Expand Down
7 changes: 6 additions & 1 deletion pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,12 @@ func (d *Distributor) send(ctx context.Context, ingester ring.InstanceDesc, time
req.Source = source

_, err = c.PushPreAlloc(ctx, req)
cortexpb.ReuseWriteRequest(req)

// We should not reuse the req in case of errors:
// See: https://github.com/grpc/grpc-go/issues/6355
if err == nil {
cortexpb.ReuseWriteRequest(req)
}

if len(metadata) > 0 {
d.ingesterAppends.WithLabelValues(ingester.Addr, typeMetadata).Inc()
Expand Down