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

PromQL: result from query_range not ordered by timestamp #5405

Open
0neSe7en opened this issue Jan 20, 2025 · 0 comments
Open

PromQL: result from query_range not ordered by timestamp #5405

0neSe7en opened this issue Jan 20, 2025 · 0 comments
Labels
C-bug Category Bugs

Comments

@0neSe7en
Copy link

0neSe7en commented Jan 20, 2025

What type of bug is this?

Incorrect result

What subsystems are affected?

Query Engine

Minimal reproduce step

When using the /v1/query_range endpoint with a PromQL query like: host_disk_reads_completed_total * host_disk_reads_completed_total returns unordered values.
seems like using binary operator between two metrics will cause this issue.

What did you expect to see?

the results should be ordered by timestamp

What did you see instead?

not ordered by timestamp

{
    "status": "success",
    "data": {
        "resultType": "matrix",
        "result": [
            {
                "metric": {
                    "__name__": "host_disk_reads_completed_total",
                    "collector": "disk",
                    "device": "disk0",
                    "host": "<mask>"
                },
                "values": [
                    [
                        1737326594.0,
                        "2672939735631361"
                    ],
                    [
                        1737326600.0,
                        "2673913964849604"
                    ],
                    [
                        1737326588.0,
                        "2672939735631361"
                    ],
                    [
                        1737326589.0,
                        "2672939735631361"
                    ],
                    [
                        1737326595.0,
                        "2672939735631361"
                    ],
                    [
                        1737326596.0,
                        "2673913964849604"
                    ],
                    [
                        1737326606.0,
                        "2673913964849604"
                    ],
                    [
                        1737326592.0, <---------------------------
                        "2672939735631361"
                    ],
                    [
                        1737326598.0,
                        "2673913964849604"
                    ],
                    [
                        1737326599.0,
                        "2673913964849604"
                    ],
                    [
                        1737326601.0,
                        "2673913964849604"
                    ],
                    [
                        1737326604.0,
                        "2673913964849604"
                    ],
                    [
                        1737326607.0,
                        "2673913964849604"
                    ],
                    [
                        1737326610.0,
                        "2673913964849604"
                    ],
                    [
                        1737326597.0,
                        "2673913964849604"
                    ],
                    [
                        1737326603.0,
                        "2673913964849604"
                    ],
                    [
                        1737326608.0,
                        "2673913964849604"
                    ],
                    [
                        1737326605.0,
                        "2673913964849604"
                    ],
                    [
                        1737326590.0,
                        "2672939735631361"
                    ],
                    [
                        1737326591.0,
                        "2672939735631361"
                    ],
                    [
                        1737326602.0,
                        "2673913964849604"
                    ],
                    [
                        1737326593.0,
                        "2672939735631361"
                    ],
                    [
                        1737326609.0,
                        "2673913964849604"
                    ]
                ]
            },
....

What operating system did you use?

macOS

What version of GreptimeDB did you use?

0.11.2

Relevant log output and stack trace

@0neSe7en 0neSe7en added the C-bug Category Bugs label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

No branches or pull requests

1 participant