Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ON_DUPLICATE min/max rules not working for negative values #588

Closed
digiyouth opened this issue Dec 1, 2020 · 2 comments · Fixed by #590
Closed

ON_DUPLICATE min/max rules not working for negative values #588

digiyouth opened this issue Dec 1, 2020 · 2 comments · Fixed by #590
Assignees
Labels
bug Something isn't working

Comments

@digiyouth
Copy link

digiyouth commented Dec 1, 2020

HI, I input these commands. Is the result correct?

127.0.0.1:6379[10]> ts.create test1 DUPLICATE_POLICY min
OK
127.0.0.1:6379[10]> ts.add test1 1 -0.05 ON_DUPLICATE min
(integer) 1
127.0.0.1:6379[10]> ts.range test1 - +
1) 1) (integer) 1
   2) -0.05
127.0.0.1:6379[10]> ts.add test1 1 -0.06 ON_DUPLICATE min
(integer) 1
127.0.0.1:6379[10]> ts.range test1 - +
1) 1) (integer) 1
   2) 0
127.0.0.1:6379[10]> ts.add test1 1 -100 ON_DUPLICATE min
(integer) 1
127.0.0.1:6379[10]> ts.range test1 - +
1) 1) (integer) 1
   2) 0
----
127.0.0.1:6379[10]> ts.info test1 debug
 1) totalSamples
 2) (integer) 1
 3) memoryUsage
 4) (integer) 4184
 5) firstTimestamp
 6) (integer) 1
 7) lastTimestamp
 8) (integer) 1
 9) retentionTime
10) (integer) 0
11) chunkCount
12) (integer) 1
13) chunkSize
14) (integer) 4096
15) chunkType
16) compressed
17) duplicatePolicy
18) min
19) labels
20) (empty list or set)
21) sourceKey
22) (nil)
23) rules
24) (empty list or set)
25) Chunks
26) 1)  1) startTimestamp
        2) (integer) 1
        3) endTimestamp
        4) (integer) 1
        5) samples
        6) (integer) 1
        7) size
        8) (integer) 4096
        9) bytesPerSample
       10) "4096"

--
redis info:
...

Modules

module:name=timeseries,ver=10406,api=1,filters=0,usedby=[],using=[],options=[]

@filipecosta90
Copy link
Contributor

Hi there @digiyouth you're totally right. Thank you for catching this one. We're fixing it right away on #590 and reply back as soon as we merge the fix.

@filipecosta90 filipecosta90 changed the title About add ... ON_DUPLICATE min ON_DUPLICATE min/max rules not working for negative values Dec 1, 2020
@digiyouth
Copy link
Author

Thank you for your work! RedisTimeSeries is very useful!

filipecosta90 added a commit that referenced this issue Dec 2, 2020
…590)

* [add] Added test_Uncompressed_Uncompressed_UpsertSample_DuplicatePolicy to mimic issue #588

* [fix] Failing unit tests in case of failed test suite run

* [fix] Fixed ON_DUPLICATE min/max rules not working for negative values. Included flow and unit tests to ensure this issue will not re-appear

* [add] Increased unit test coverage

* [fix] Removed extra aesthetics parenthesis on handleDuplicateSample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants