Compare commits

...

2 Commits

Author SHA1 Message Date
Nikolay
bcc142f5e3 Update CHANGELOG.md
Signed-off-by: Nikolay <nik@victoriametrics.com>
2026-08-18 11:28:05 +02:00
f41gh7
98e6dd60ed app/vmselect: properly return memory to the pool
Previously in case of small request processed by vmselect, it may not
reuse sortBlock structure in case of storage block parsing error or
request complexity error.

 This commit addresses these issues and properly puts sort blocks
back to the pool.
2026-08-18 11:06:43 +02:00
2 changed files with 14 additions and 2 deletions

View File

@@ -502,7 +502,8 @@ func (pts *packedTimeseries) unpackTo(dst []*sortBlock, tbfs []*tmpBlocksFile, t
initUnpackWork(upw, addr)
upw.unpack(tmpBlock)
if upw.err != nil {
return dst, upw.err
err = upw.err
break
}
samples += len(upw.sb.Timestamps)
if *maxSamplesPerSeries > 0 && samples > *maxSamplesPerSeries {
@@ -518,7 +519,11 @@ func (pts *packedTimeseries) unpackTo(dst []*sortBlock, tbfs []*tmpBlocksFile, t
}
putTmpStorageBlock(tmpBlock)
putUnpackWork(upw)
if err != nil {
for _, sb := range dst {
putSortBlock(sb)
}
}
return dst, err
}
@@ -584,6 +589,11 @@ func (pts *packedTimeseries) unpackTo(dst []*sortBlock, tbfs []*tmpBlocksFile, t
}
putUnpackWork(upw)
}
if firstErr != nil {
for _, sb := range dst {
putSortBlock(sb)
}
}
return dst, firstErr
}

View File

@@ -26,6 +26,8 @@ See also [LTS releases](https://docs.victoriametrics.com/victoriametrics/lts-rel
## tip
* BUGFIX: `vmselect` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/): consistently re-use memory during storage blocks unpacking on parsing storage block error. See [#11421](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/11421).
## [v1.150.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.150.0)
Released at 2026-08-17