From c7fed9087eacfeed6167f827304a91f9c8b0fe0b Mon Sep 17 00:00:00 2001 From: Yi Jin Date: Mon, 8 Apr 2024 17:10:14 -0700 Subject: [PATCH] fix issues/7248 which runs sequentially Signed-off-by: Yi Jin --- pkg/receive/handler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/receive/handler.go b/pkg/receive/handler.go index 5756296db3..827abe22a6 100644 --- a/pkg/receive/handler.go +++ b/pkg/receive/handler.go @@ -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 @@ -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) } }