From d8c24c6bde7c3b3f03f6c3ef2a8c8c8238e8f789 Mon Sep 17 00:00:00 2001 From: Patryk Prus
Date: Tue, 10 Feb 2026 12:44:06 -0500 Subject: [PATCH] tsdb/index: export sentinel error for symbol table size exceeded Signed-off-by: Patryk Prus
---
tsdb/index/index.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tsdb/index/index.go b/tsdb/index/index.go
index 493264b87f..9b907bb7a7 100644
--- a/tsdb/index/index.go
+++ b/tsdb/index/index.go
@@ -101,6 +101,9 @@ var ErrPostingsOffsetTableTooLarge = errors.New("length size exceeds 4 bytes")
// ErrIndexExceeds64GiB is returned when the index file would exceed the 64GiB limit.
var ErrIndexExceeds64GiB = errors.New("exceeding max size of 64GiB")
+// ErrSymbolTableTooLarge is returned when the symbol table size exceeds 4 bytes (4GiB limit).
+var ErrSymbolTableTooLarge = fmt.Errorf("symbol table size exceeds %d bytes", uint32(math.MaxUint32))
+
// The table gets initialized with sync.Once but may still cause a race
// with any other use of the crc32 package anywhere. Thus we initialize it
// before.
@@ -550,7 +553,7 @@ func (w *Writer) finishSymbols() error {
symbolTableSize := w.f.pos - w.toc.Symbols - 4
// The symbol table's