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

VictoriaLogs _time: doesn't honor exclusive/inclusive range bounds ) and ] #6293

Closed
eduardbareev opened this issue May 16, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working victorialogs

Comments

@eduardbareev
Copy link

eduardbareev commented May 16, 2024

Describe the bug

curl --json '
{ "_msg": "m1", "_time":"2024-05-12T00:00:00.111+00:00" }
{ "_msg": "m2", "_time":"2024-05-12T00:00:00.222+00:00" }
{ "_msg": "m3", "_time":"2024-05-12T00:00:00.333+00:00" }
{ "_msg": "m4", "_time":"2024-05-12T00:00:00.444+00:00" }
{ "_msg": "m5", "_time":"2024-05-12T00:00:00.555+00:00" }
' 'http://localhost:9428/insert/jsonline'

sleep 3

# example 1

# requested range has inclusive upper bound, 
# but boundary point m3 is missing in result
curl 'http://localhost:9428/select/logsql/query' --data-urlencode \
    'query=_time:[0,2024-05-12T00:00:00.333+00:00]  '
{"_time":"2024-05-12T00:00:00.111Z","_stream":"{}","_msg":"m1"}
{"_time":"2024-05-12T00:00:00.222Z","_stream":"{}","_msg":"m2"}

# works as expected here
curl 'http://localhost:9428/select/logsql/query' --data-urlencode \
    'query=_time:[0,2024-05-12T00:00:00.333+00:00)  '
{"_time":"2024-05-12T00:00:00.111Z","_stream":"{}","_msg":"m1"}
{"_time":"2024-05-12T00:00:00.222Z","_stream":"{}","_msg":"m2"}


# example 2

# works as expected here
curl 'http://localhost:9428/select/logsql/query' --data-urlencode \
    'query=_time:[0,2024-05-12T00:00:00.555+00:00]  '
{"_time":"2024-05-12T00:00:00.111Z","_stream":"{}","_msg":"m1"}
{"_time":"2024-05-12T00:00:00.222Z","_stream":"{}","_msg":"m2"}
{"_time":"2024-05-12T00:00:00.333Z","_stream":"{}","_msg":"m3"}
{"_time":"2024-05-12T00:00:00.444Z","_stream":"{}","_msg":"m4"}
{"_time":"2024-05-12T00:00:00.555Z","_stream":"{}","_msg":"m5"}

# requested range has exclusive upper bound, but 
# boundary point m5 gets included into result
curl 'http://localhost:9428/select/logsql/query' --data-urlencode \
    'query=_time:[0,2024-05-12T00:00:00.555+00:00)  '
{"_time":"2024-05-12T00:00:00.111Z","_stream":"{}","_msg":"m1"}
{"_time":"2024-05-12T00:00:00.222Z","_stream":"{}","_msg":"m2"}
{"_time":"2024-05-12T00:00:00.333Z","_stream":"{}","_msg":"m3"}
{"_time":"2024-05-12T00:00:00.444Z","_stream":"{}","_msg":"m4"}
{"_time":"2024-05-12T00:00:00.555Z","_stream":"{}","_msg":"m5"}

Probably related to float, nonetheless this doesn't look right.

Version

victoria-logs-20240515-025846-tags-v0.7.0-victorialogs-0-g6fdba8599d

@Amper
Copy link
Contributor

Amper commented May 17, 2024

Hey @eduardbareev.
This issue should be fixed after this PR.

@hagen1778 hagen1778 removed the logs label May 20, 2024
valyala added a commit that referenced this issue May 22, 2024
…6295)

fix for #6293

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
valyala added a commit that referenced this issue May 22, 2024
…6295)

fix for #6293

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
@valyala
Copy link
Collaborator

valyala commented May 22, 2024

The issue has been fixed in VictoriaLogs v0.9.0.

@valyala valyala closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working victorialogs
Projects
None yet
Development

No branches or pull requests

4 participants