ts.range strange behaviour

Thanks for this beautiful module. It appears to fit my requirement very well. However, I found a seemingly strange issue today.

Here is a screenshot of the problem - Should be self-explanatory

ts.range appears to give incorrect values for the same timestamp in some select keys. The actual value I tried to store is -6.56. Please let me know why this is happening. This is driving me crazy in an otherwise nice module.

Hello Bharani,

Thank you for the post.

It seems like a bug. Can you add more details?

  • What version are you using?
  • A bit more information on the data.
  • Is it possible to share an RDB file so the issue can be analyzed?
    Regards,

Ariel

Sure

  1. This is the redis version. I got it from docker hub (https://hub.docker.com/r/redislabs/redistimeseries)

Redis server v=5.0.5 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=5e8f7e5111134784

  1. I have got a cleaned up log of the TS.ADD for this particular key (picked by redis-cli MONITOR) with which you should be able to re-create the key. I was able to re-create the problem by just running this through redis-cli

  2. I can help with this if #2 isn’t helpful

Thanks,

Bharani

ts.range-bug-data.txt (333 KB)

Hello Bharani,

The bug is being fixed. The PR pending is pending and I will notify you when a new fixed version will be released.

Thank you for your helpful input.

Regards,

Ariel

Sure, Thanks a lot. Hope to see the fixed version soon as we are evaluating multiple options at this point,

Hello Bharani,

We have released a patch as 1.2.4

Please refresh your docker to make sure you are running the latest version.

Thank you again for your input.

Ariel

Excellent. I just verified it and its working as it should. Gives me a lot of confidence to pursue further. Thanks again for the quick turnaround time. Cheers!

Hi Ariel,
I may have another issue. Please take a look at this screenshot. TS.ADD shows that the labels added for pct and down_from_52 are different from what is showing when I fetch the entries using ts.mget. It is the same key, timestamp and the value as well is stored correctly. The problem is only with labels. The labels actually shown are from the first entry in the time series. Is there something wrong with the way I am using the module? Please let me know. Always thanks for your support!

Cheers,

Bharani

My bad. I just checked out the documentation

If this command is used to add data to an existing timeseries, retentionTime and labels are ignored.

So I think it is functioning as per documentation.

I have a follow-up question though. If I wanted to store some additional attributes along with the value in the timeseries, what is the best way to do this?

Hello Bharani,

If the other attributes are values, you can have extra time-series with an additional LABEL=arg_name to store them and then call TS.MRANGE to fetch them all. Otherwise, you might be better off with RedisStreams.

Thanks Ariel that makes sense. I did evaluate Streams before I got into RedisTimeSeries. I have found a way to overcome this limitation. The rule aggregation in RTS is more important to me at this point so will work with it the way it is. Thanks again for this module. It is showing a lot of promise.