[common] Reject out-of-range bloom filter items and fpp options - #10108
Open
jackylee-ch wants to merge 1 commit into
Open
jackylee-ch wants to merge 1 commit into
jackylee-ch wants to merge 1 commit into
Conversation
The bloom filter file index reads items and fpp from table options with no bounds. A percentage-shaped fpp such as 10 makes every write fail with a bare NegativeArraySizeException that names neither the option nor the column; fpp=0 overflows the same way; fpp=1 or a negative value silently builds a one-byte filter that prunes nothing; and a very large items overflows the bit-set size. Reject fpp outside (0, 1) and non-positive items at the writer -- the read path never consults them, so an already-written table stays readable -- and guard the bit-count overflow in BloomFilter64, so a bad option fails at write time with a message naming it.
jackylee-ch
force-pushed
the
bloom-filter-option-validation
branch
from
September 23, 2026 04:55
4ab826d to
916fb0c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The bloom filter file index reads
itemsandfppfrom table options with no bounds. A percentage-shapedfpplike10makes every write fail with a bareNegativeArraySizeException;fpp = 0overflows the same way;fpp = 1or negative silently builds a one-byte filter that prunes nothing; a largeitemsoverflows the bit-set size.Reject
fppoutside(0, 1)and non-positiveitemsin the writer (the read path never consults them, so existing tables stay readable), and guard the bit-count overflow inBloomFilter64. A bad option now fails at write time naming it. Mirrors #9765 for range-bitmapchunk-size.Tests
BloomFilterFileIndexTest.testRejectsInvalidOptions:fpp= 10 / 0 / 1.0 / -0.1,items= 0,items = Integer.MAX_VALUE, plus a valid config. Fails on master, passes here.Written with Claude Code; verification is mine.