Files
greptimedb/src/common
dennis zhuang 01523bec3d fix(promql): treat equal histogram start timestamps as no reset (#10660)
* 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>
2026-11-27 08:51:39 +00:00
..
2026-11-26 18:40:08 +08:00