danni-m / redis-timeseries

Future development of redis-timeseries is at github.com/RedisLabsModules/redis-timeseries.

Home Page:https://github.com/RedisLabsModules/redis-timeseries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how does retentionSecs works?

fauzanqadri opened this issue · comments

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?

hi @fauzanqadri,
The way it works is as follows:

  1. The timeseries are stored in chunks, each chunk has X amount of samples, the default is 360 .
  2. The allocations and free of memory happens at the chunk resolution, meaning we delete or create a whole chunk.
  3. A chunk would be deleted if all of the samples are too old according to retentionSec policy.

What you see is expected.

ohh i see...
thanks for the explanation.

i will close the issue for now...