mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect: properly calculate start
param for queries with too big look-behind window (#5630)
Properly determine time range search for instant queries with too big look-behind window like `foo[100y]`. Previously, such queries could return empty responses even if `foo` is present in database. https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5553 Signed-off-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
parent
abd3641328
commit
30284e9fd4
2 changed files with 5 additions and 0 deletions
|
@ -699,6 +699,9 @@ func QueryHandler(qt *querytracer.Tracer, startTime time.Time, w http.ResponseWr
|
||||||
start -= offset
|
start -= offset
|
||||||
end := start
|
end := start
|
||||||
start = end - window
|
start = end - window
|
||||||
|
if start < 0 {
|
||||||
|
start = 0
|
||||||
|
}
|
||||||
// Do not include data point with a timestamp matching the lower boundary of the window as Prometheus does.
|
// Do not include data point with a timestamp matching the lower boundary of the window as Prometheus does.
|
||||||
start++
|
start++
|
||||||
if end < start {
|
if end < start {
|
||||||
|
|
|
@ -11,6 +11,8 @@ The following `tip` changes can be tested by building VictoriaMetrics components
|
||||||
|
|
||||||
## v1.93.x long-time support release (LTS)
|
## v1.93.x long-time support release (LTS)
|
||||||
|
|
||||||
|
* BUGFIX: [vmselect](https://docs.victoriametrics.com/vmselect.html): properly determine time range search for instant queries with too big look-behind window like `foo[100y]`. Previously, such queries could return empty responses even if `foo` is present in database.
|
||||||
|
|
||||||
## [v1.93.10](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.10)
|
## [v1.93.10](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.93.10)
|
||||||
|
|
||||||
Released at 2024-01-17
|
Released at 2024-01-17
|
||||||
|
|
Loading…
Reference in a new issue