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

Precision error when specifying time in RFC3339 format vs. UNIX milliseconds #5801

Closed
dandv opened this issue Feb 12, 2024 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@dandv
Copy link
Contributor

dandv commented Feb 12, 2024

Describe the bug

Certain times seem to trigger a 1ms error if specified in RFC3339 format instead of UNIX milliseconds. This can have consequences such as missing a point if the end parameter is specified in RFC3339 and a point at that timestamp does in fact exist.

To Reproduce

node -e 'console.log(new Date(time=1582301269433).toISOString())'  # 2020-02-21T16:07:49.433Z

# create a point
curl http://localhost:8428/api/v1/import/prometheus -d 'series1{label="foo"} 10 1582301269433'

export VMQURL=http://localhost:8428/api/v1/query

# misses the point
curl -s $VMQURL -d 'query=count_over_time(series1[1ms])' -d 'time=2020-02-21T16:07:49.433Z'

# 1ms later, does return the point
curl -s $VMQURL -d 'query=count_over_time(series1[1ms])' -d 'time=2020-02-21T16:07:49.434Z'

Version

victoria-metrics-20240130-205929-tags-v1.97.0-0-gfcc8b14f8

Logs

No response

Screenshots

No response

Used command-line flags

-retentionPeriod=100y -search.latencyOffset=1s

Additional information

No response

@dandv dandv added the bug Something isn't working label Feb 12, 2024
@Amper Amper self-assigned this Feb 14, 2024
Amper added a commit that referenced this issue Feb 15, 2024
@Amper
Copy link
Contributor

Amper commented Feb 16, 2024

#5814

Amper added a commit that referenced this issue Feb 20, 2024
…n parsing time in RFC3339 format (#5801)"

This reverts commit a7a04bd
f41gh7 added a commit that referenced this issue Feb 22, 2024
…39 format (#5814)

* [lib/promutils, lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)

* fixed tests

* fixed test

* Revert "fixed test"

This reverts commit 8a29764.

* Revert "fixed tests"

This reverts commit 9ce13d1.

* Revert "[lib/promutils, lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)"

This reverts commit a7a04bd

* [lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)

---------

Co-authored-by: Nikolay <nik@victoriametrics.com>
valyala pushed a commit that referenced this issue Feb 22, 2024
…39 format (#5814)

* [lib/promutils, lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)

* fixed tests

* fixed test

* Revert "fixed test"

This reverts commit 8a29764.

* Revert "fixed tests"

This reverts commit 9ce13d1.

* Revert "[lib/promutils, lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)"

This reverts commit a7a04bd

* [lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)

---------

Co-authored-by: Nikolay <nik@victoriametrics.com>
valyala pushed a commit that referenced this issue Feb 22, 2024
…39 format (#5814)

* [lib/promutils, lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)

* fixed tests

* fixed test

* Revert "fixed test"

This reverts commit 8a29764.

* Revert "fixed tests"

This reverts commit 9ce13d1.

* Revert "[lib/promutils, lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)"

This reverts commit a7a04bd

* [lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)

---------

Co-authored-by: Nikolay <nik@victoriametrics.com>
valyala added a commit that referenced this issue Feb 22, 2024
…ction

This should prevent from bugs similar to #5801 in the future

This is a follow-up for ce3ec3f
valyala pushed a commit that referenced this issue Feb 22, 2024
…39 format (#5814)

* [lib/promutils, lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)

* fixed tests

* fixed test

* Revert "fixed test"

This reverts commit 8a29764.

* Revert "fixed tests"

This reverts commit 9ce13d1.

* Revert "[lib/promutils, lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)"

This reverts commit a7a04bd

* [lib/httputils] fixed floating-point error when parsing time in RFC3339 format (#5801)

---------

Co-authored-by: Nikolay <nik@victoriametrics.com>
valyala added a commit that referenced this issue Feb 22, 2024
…ction

This should prevent from bugs similar to #5801 in the future

This is a follow-up for ce3ec3f
@valyala
Copy link
Collaborator

valyala commented Mar 1, 2024

FYI, the fix for this issue has been included in v1.93.13 LTS release.

@valyala
Copy link
Collaborator

valyala commented Mar 1, 2024

FYI, the fix for this issue has been included in v1.97.3 LTS release.

@valyala
Copy link
Collaborator

valyala commented Mar 1, 2024

The fix for this issue has been included in v1.99.0 release. Closing the issue as fixed.

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

No branches or pull requests

3 participants