lib/mergeset: fix flushing incorrect set of inmemoryBlocks (#6089)

Follow-up for bace9a2501

Related:
- https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6069
- https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5959

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
This commit is contained in:
Zakhar Bessarab 2024-04-11 11:26:06 +04:00 committed by GitHub
parent a4945c0bf0
commit 2205de2391
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -32,9 +32,9 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
* FEATURE: [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager.html): allow specifying custom backup interval via `-backupInterval` command-line flag. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5966).
* BUGFIX: fix incorrect merge of partitions which could lead to losing records for IndexDB. See [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5959) and [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6069) issues.
* BUGFIX: [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager.html): fix panic when performing a restore from GCS. Previously, filters for GCS objects were not properly set which caused objects to be returned instead of prefixes.
## [v1.100.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.100.0)
Released at 2024-04-04

View file

@ -198,7 +198,7 @@ func (riss *rawItemsShards) addIbsToFlush(tb *Table, ibsToFlush []*inmemoryBlock
}
riss.ibsToFlush = append(riss.ibsToFlush, ibsToFlush...)
if len(riss.ibsToFlush) >= maxBlocksPerShard*cgroup.AvailableCPUs() {
ibsToMerge = ibsToFlush
ibsToMerge = riss.ibsToFlush
riss.ibsToFlush = nil
}
riss.ibsToFlushLock.Unlock()