Skip to content

Commit b902c37

Browse files
committed
Get back copying.
Signed-off-by: Bartlomiej Plotka <[email protected]>
1 parent f51776a commit b902c37

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pkg/store/multitsdb.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,19 @@ func (s *tenantSeriesSetServer) Send(r *storepb.SeriesResponse) error {
139139
s.directCh.send(r)
140140
return nil
141141
}
142+
143+
// TODO(bwplotka): Consider avoid copying / learn why it has to copied.
144+
chunks := make([]storepb.AggrChunk, len(series.Chunks))
145+
copy(chunks, series.Chunks)
146+
142147
// For series, pass it to our AggChunkSeriesSet.
143148
select {
144149
case <-s.ctx.Done():
145150
return s.ctx.Err()
146-
case s.recv <- series:
151+
case s.recv <- &storepb.Series{
152+
Labels: series.Labels,
153+
Chunks: chunks,
154+
}:
147155
return nil
148156
}
149157
}

pkg/store/proxy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func newCancellableRespChannel(ctx context.Context, buffer int) (*cancellableRes
195195
return &cancellableRespSender{ctx: ctx, ch: respCh}, respCh
196196
}
197197

198-
// send or returns on cancel.
198+
// send or return on cancel.
199199
func (s cancellableRespSender) send(r *storepb.SeriesResponse) {
200200
select {
201201
case <-s.ctx.Done():

0 commit comments

Comments
 (0)