This repository was archived by the owner on Aug 23, 2023. It is now read-only.
Duplicate Put
in point slice pool from mergeSeries
#1875
Labels
Describe the bug
In certain scenarios during a render request a slice can be returned to the pool 2 times. We saw corrupted responses because of this and so deployed a change that (within a single render) detects this case, does not return the slice to the pool twice and logs additional information. With this info I think I've found where it happens. In the (likely rare) case where there are identical time-series with 2 different intervals,
mergeSeries
will merge them together to form a single normalized value.It then puts all the other series back into the pool and only keeps the first one. However,
normalize
already puts the new normalized value into the datamap. So, in the scenario where there is seriesfoo.bar
with intervals 60 (let's call thisfoo60
) and 30 (foo30
) (in this order), the process flow goes something like:mergeSeries
callsnormalize(datamap, [foo60, foo30])
normalize
keepsfoo60
(nothing to do)normalize
copiesfoo30
, consolidates it to 60 seconds and adds it to the datamap (let's call thisfoo60_2
)foo30
to be GC'd. It did not go into the poolmergeSeries
then iterates over the points infoo60
checking if it can fillNaN
values fromfoo60_2
mergeSeries
addsfoo60_2.Datapoints
into the pool, even though it is already in the datamap!Helpful Information
Metrictank Version:
v1.0-52
(custom build off of commit e085017)Golang Version:
go1.12.7
The text was updated successfully, but these errors were encountered: