how does retentionSecs works?
fauzanqadri opened this issue · comments
Fauzan Qadri commented
I am trying to create a new time-series bucket with retentionSec
option, but somehow it does not trim the data after a given time.
here is what im doing..
TS.CREATE helloWorld 10
TS.add helloWorld 1530610870 1
TS.add helloWorld 1530610871 2
after 10 sec, i try the range query, but the data is still there
in my understanding retentionSec
will remove the data after time is passed
my question is my understanding is right or did i missing something here?
Danni Moiseyev commented
hi @fauzanqadri,
The way it works is as follows:
- The timeseries are stored in chunks, each chunk has X amount of samples, the default is 360 .
- The allocations and free of memory happens at the chunk resolution, meaning we delete or create a whole chunk.
- A chunk would be deleted if all of the samples are too old according to
retentionSec
policy.
What you see is expected.
Fauzan Qadri commented
ohh i see...
thanks for the explanation.
i will close the issue for now...