diff --git a/docs/VictoriaLogs/CHANGELOG.md b/docs/VictoriaLogs/CHANGELOG.md index d6474b93f..8e2037265 100644 --- a/docs/VictoriaLogs/CHANGELOG.md +++ b/docs/VictoriaLogs/CHANGELOG.md @@ -15,6 +15,8 @@ according to [these docs](https://docs.victoriametrics.com/victorialogs/quicksta ## tip +* BUGFIX: fix `runtime error: index out of range [0] with length 0` panic during low-rate data ingestion. The panic has been introduced in [v0.38.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.38.0-victorialogs). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/7391). + ## [v0.38.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.38.0-victorialogs) Released at 2024-10-29 diff --git a/lib/logstorage/block_stream_writer.go b/lib/logstorage/block_stream_writer.go index 3d3a54382..fcffb3eab 100644 --- a/lib/logstorage/block_stream_writer.go +++ b/lib/logstorage/block_stream_writer.go @@ -312,7 +312,10 @@ func (bsw *blockStreamWriter) MustInitForFilePart(path string, nocache bool, blo func adjustBloomValuesShardsCount(n uint64) uint64 { if n == 0 { - return n + // At least a single shard is needed for writing potential non-const fields, + // which can appear after merging of const fields. + // This fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/7391 + return 1 } n = 1 << bits.Len64(n-1)