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

Rules do not work on DBs other than 0 #1118

Closed
ahmadazizi opened this issue Apr 7, 2022 · 5 comments
Closed

Rules do not work on DBs other than 0 #1118

ahmadazizi opened this issue Apr 7, 2022 · 5 comments
Labels
wontfix This will not be worked on

Comments

@ahmadazizi
Copy link

If you create a rule on a timeseries on a DB other than 0 (e.g. 5), as soon as you add some data, the rule will disappear and never run.

Affected redis versions: all versions
Affected timeseries version: all versions

@gkorland gkorland added the bug Something isn't working label Apr 10, 2022
@gkorland
Copy link
Contributor

@ahmadazizi thanks for reporting the bug, but We don't plan to add support to SELECT in the near future
Can you please describe your use case?

@ahmadazizi
Copy link
Author

Thank you, We have separate DBs for each organization, timeseries are organized in their respective DBs.
This is also happening silently, rules cease to exist without any warning and in addiction this type of happening was never mentioned in doc/guides, tending to mislead finding the source of problem.

@OfirMos
Copy link
Contributor

OfirMos commented Apr 12, 2022

Hi @ahmadazizi thanks for reporting the bug, it wasn't reproduced on master or 1.6:

`root@b3444609487c:/data# redis-cli
127.0.0.1:6379> SELECT 1
OK
127.0.0.1:6379[1]> ts.create t1
OK
127.0.0.1:6379[1]> keys *

  1. "t1"
    127.0.0.1:6379[1]> ts.create t2
    OK
    127.0.0.1:6379[1]> ts.createrule AGGREGATION sum 10
    (error) ERR wrong number of arguments for 'ts.createrule' command
    127.0.0.1:6379[1]> ts.createrule t1 t2 AGGREGATION sum 10
    OK
    127.0.0.1:6379[1]> keys *
  2. "t1"
  3. "t2"
    127.0.0.1:6379[1]> ts.add t1 3 5
    (integer) 3
    127.0.0.1:6379[1]> ts.add t1 7 8
    (integer) 7
    127.0.0.1:6379[1]> ts.add t1 15 9
    (integer) 15
    127.0.0.1:6379[1]> keys *
  4. "t1"
  5. "t2"
    127.0.0.1:6379[1]> ts.range t1 - +
    1. (integer) 3
    2. 5
    1. (integer) 7
    2. 8
    1. (integer) 15
    2. 9
      127.0.0.1:6379[1]> ts.range t2 - +
    1. (integer) 0
    2. 13`

Can you pls share a script that reproduces this bug?

@ahmadazizi
Copy link
Author

MAKING SURE KEYS DO NOT EXIST WITH THE SAME NAME IN DB0

[5] > select 0
"OK"

del t1
(integer) 0

del t2
(integer) 0

select 2
"OK"

[2] > keys *
(empty list or set)

[2] > ts.create t1
"OK"

[2] > ts.create t2
"OK"

[2] > ts.createrule t1 t2 AGGREGATION MIN 5
"OK"

[2] > ts.info t1

  1. "totalSamples"
  2. "0"
  3. "memoryUsage"
  4. "4240"
  5. "firstTimestamp"
  6. "0"
  7. "lastTimestamp"
  8. "0"
  9. "retentionTime"
  10. "0"
  11. "chunkCount"
  12. "1"
  13. "chunkSize"
  14. "4096"
  15. "chunkType"
  16. "compressed"
  17. "duplicatePolicy"
  18. "null"
  19. "labels"
  20. (empty list or set)
  21. "sourceKey"
  22. "null"
  23. "rules"
      1. "t2"
    1. "5"
    2. "MIN"

[2] > ts.add t1 10 50
(integer) 10

[2] > ts.add t1 5 999
(integer) 5

RULE DOES NOT EXIST AFTER ADDING SAMPLES:

[2] > ts.info t1

  1. "totalSamples"
  2. "2"
  3. "memoryUsage"
  4. "4184"
  5. "firstTimestamp"
  6. "5"
  7. "lastTimestamp"
  8. "10"
  9. "retentionTime"
  10. "0"
  11. "chunkCount"
  12. "1"
  13. "chunkSize"
  14. "4096"
  15. "chunkType"
  16. "compressed"
  17. "duplicatePolicy"
  18. "null"
  19. "labels"
  20. (empty list or set)
  21. "sourceKey"
  22. "null"
  23. "rules"
  24. (empty list or set)

[2] > ts.range t2 - +
(empty list or set)

THIS DOES NOT HAPPEN IN DB0

@LiorKogan
Copy link
Member

@LiorKogan LiorKogan added wontfix This will not be worked on and removed bug Something isn't working labels May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants