app/vmselect/netstorage: prevent from deadlock at unpackUpdateAddrs() for time series with the updated data

This commit is contained in:
Aliaksandr Valialkin 2023-07-06 10:14:35 -07:00 committed by f41gh7
parent 23e53bdb80
commit 9e2d77ea62
No known key found for this signature in database
GPG key ID: 4558311CF775EC72

View file

@ -684,9 +684,11 @@ func (pts *packedTimeseries) unpackUpdateAddrs(tbfs []*tmpBlocksFile, tr storage
} }
// Spread work among worker channels. // Spread work among worker channels.
for i, upws := range upwss { i := 0
idx := i % len(workChs) for _, upws := range upwss {
for _, upw := range upws { for _, upw := range upws {
idx := i % len(workChs)
i++
workChs[idx] <- upw workChs[idx] <- upw
} }
} }