Skip to content

Commit

Permalink
One more case for zero chunk size / mode
Browse files Browse the repository at this point in the history
Extends on #263
  • Loading branch information
abhinavdangeti committed Oct 16, 2024
1 parent 0c6f397 commit 54bf3bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54bf3bf

Please sign in to comment.