From 54bf3bfce97b701cdd2bceaadc47c9c058572f73 Mon Sep 17 00:00:00 2001 From: Abhinav Dangeti Date: Wed, 16 Oct 2024 08:40:24 -0600 Subject: [PATCH] One more case for zero chunk size / mode Extends on https://github.com/blevesearch/zapx/pull/263 --- chunk.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chunk.go b/chunk.go index 62c5deaf..53d124f0 100644 --- a/chunk.go +++ b/chunk.go @@ -36,6 +36,9 @@ var ErrChunkSizeZero = errors.New("chunk size is zero") // between a valid chunk size of 0 and an error by checking for ErrChunkSizeZero. func getChunkSize(chunkMode uint32, cardinality uint64, maxDocs uint64) (uint64, error) { switch { + case chunkMode == 0: + return 0, ErrChunkSizeZero + // any chunkMode <= 1024 will always chunk with chunkSize=chunkMode case chunkMode <= 1024: // legacy chunk size