mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-02 23:45:24 +00:00
* fix(promql): treat equal histogram start timestamps as no reset in native route Prometheus isStartTimestampReset returns false when the previous and current samples carry the same start timestamp, before any other check. The native rule skipped that check, so two samples whose shared start timestamp is later than the earlier sample (which remote write v2 accepts) were counted as a counter reset: resets() answered 1 instead of 0 and increase()/rate() added the earlier value back. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix(promql): share the start-timestamp reset rule between routes The legacy planner still read two samples sharing a start timestamp later than the earlier sample as a reset, so resets() answered 1 there and 0 on the native route. Both routes now call one rule that follows Prometheus isStartTimestampReset. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test(promql): pin a bucket drop under an unchanged start timestamp as a reset Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>