From ec16351e7b612e266bf9784c988588b4badbc996 Mon Sep 17 00:00:00 2001 From: eastorski Date: Tue, 27 Jan 2026 10:33:28 +0000 Subject: [PATCH] Fixed index building for v-1 snapshot format --- db/state/history.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/db/state/history.go b/db/state/history.go index e7a528b276f..5ff0befb9e4 100644 --- a/db/state/history.go +++ b/db/state/history.go @@ -300,11 +300,17 @@ func (h *History) buildVI(ctx context.Context, historyIdxPath string, hist, efHi } // file not the config is the source of truth for the .v file compression state - if hist.CompressedPageValuesCount() == 0 { + compressedPageValuesCount := hist.CompressedPageValuesCount() + + if hist.CompressionFormatVersion() == seg.FileCompressionFormatV0 { + compressedPageValuesCount = h.HistoryValuesOnCompressedPage + } + + if compressedPageValuesCount == 0 { valOffset, _ = histReader.Skip() } else { i++ - if i%hist.CompressedPageValuesCount() == 0 { + if i%compressedPageValuesCount == 0 { valOffset, _ = histReader.Skip() } }