Skip to content

Commit

Permalink
fix issues/7248 which runs sequentially
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Jin <[email protected]>
  • Loading branch information
jnyi committed Apr 9, 2024
1 parent 995b2b5 commit c7fed90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/receive/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ func (h *Handler) distributeTimeseriesToReplicas(
if err != nil {
return nil, nil, err
}
endpointReplica := endpointReplica{endpoint: endpoint, replica: rn}
endpointReplica := endpointReplica{endpoint: endpoint, replica: 0}
var writeDestination = remoteWrites
if endpoint == h.options.Endpoint {
writeDestination = localWrites
Expand Down Expand Up @@ -804,13 +804,13 @@ func (h *Handler) sendWrites(
// Do the writes to the local node first. This should be easy and fast.
for writeDestination := range localWrites {
func(writeDestination endpointReplica) {
h.sendLocalWrite(ctx, writeDestination, params.tenant, localWrites[writeDestination], responses)
go h.sendLocalWrite(ctx, writeDestination, params.tenant, localWrites[writeDestination], responses)
}(writeDestination)
}

// Do the writes to remote nodes. Run them all in parallel.
for writeDestination := range remoteWrites {
h.sendRemoteWrite(ctx, params.tenant, writeDestination, remoteWrites[writeDestination], params.alreadyReplicated, responses, wg)
go h.sendRemoteWrite(ctx, params.tenant, writeDestination, remoteWrites[writeDestination], params.alreadyReplicated, responses, wg)
}
}

Expand Down

0 comments on commit c7fed90

Please sign in to comment.