Repository navigation
Batch Bloom filter probes for aligned metadata cache misses - #19514
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
This test introduces batching over multiple value columns (s1,s2), but the first query only… · New The matcher only checks that the batch contains\"absent\", but it doesn’t verify the key… · New Depending on a SNAPSHOT can make builds non-reproducible if the snapshot is garbage-collected or… · New
What changed in this PR
Updates IoTDB’s aligned metadata cache miss path to use TsFile’s in-place batch Bloom filter probing, reducing per-measurement Bloom probes and only loading metadata for possible matches.
Changes:
- Bump TsFile dependency to a snapshot containing the batch Bloom filter API.
- Switch
TimeSeriesMetadataCachefrom per-measurement Bloom checks toremoveNotExistingMeasurements(...)batch probing. - Update unit tests to validate batched Bloom probing behavior for aligned cache misses.
| File | Description |
|---|---|
| pom.xml | Bumps TsFile version to a snapshot that provides the batch Bloom filter API used by this PR. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/buffer/TimeSeriesMetadataCache.java | Replaces per-measurement Bloom lookups with a batched, in-place Bloom filtering call and callback to record nulls. |
| iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/buffer/TimeSeriesMetadataCacheTest.java | Adjusts tests to reflect/verify the new batched Bloom probing behavior. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19514 +/- ##
============================================
+ Coverage 50.78% 50.92% +0.13%
Complexity 144 144
============================================
Files 5788 5790 +2
Lines 428227 428963 +736
Branches 56995 57093 +98
============================================
+ Hits 217458 218431 +973
+ Misses 210769 210532 -237 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
5 open issues
This test currently delegates to the real Bloom filter implementation (callRealMethod()), which… · New Depending on a SNAPSHOT can make builds non-reproducible if the snapshot is garbage-collected or… The matcher only checks that the batch contains\"absent\", but it doesn’t verify the key… This test introduces batching over multiple value columns (s1,s2), but the first query only…NonExistMeasurementConsumeris grammatically ambiguous and inconsistent with the surrounding API… · New
Review effort: Lite
| <xz.version>1.9</xz.version> | ||
| <zstd-jni.version>1.5.6-3</zstd-jni.version> | ||
| <tsfile.version>2.5.1-261120-SNAPSHOT</tsfile.version> | ||
| <tsfile.version>2.5.1-261203-2-SNAPSHOT</tsfile.version> |
There was a problem hiding this comment.
version should be changed to 2.5.1-261203-SNAPSHOT
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
5 resolved since last review
This test currently delegates to the real Bloom filter implementation (callRealMethod()), which… Depending on a SNAPSHOT can make builds non-reproducible if the snapshot is garbage-collected or… The matcher only checks that the batch contains\"absent\", but it doesn’t verify the key… This test introduces batching over multiple value columns (s1,s2), but the first query only…NonExistMeasurementConsumeris grammatically ambiguous and inconsistent with the surrounding API…
Review effort: Lite
| // The device gate already checked the time column. The reader still needs its metadata. | ||
| boolean readTimeColumn = pending.remove(""); | ||
| if (!pending.isEmpty()) { | ||
| bloomFilter.removeNotExistingMeasurements( | ||
| device, pending, new AbsentMeasurementConsumer(tsFileID, debug, result)); | ||
| } | ||
| if (readTimeColumn) { | ||
| pending.add(""); | ||
| } |
|





Summary
Use TsFile's batch Bloom filter API for aligned metadata cache misses. This builds on the selective metadata read in IoTDB #19198 and uses the in-place Bloom filter API in TsFile #1183, built on TsFile #1143.
The time-column check can still rule out a device before looking up its value columns. Both ordinary aligned scans and external TsFile scans submit the remaining value columns in one batch per file. TsFile removes definite misses from the pending set in place. IoTDB uses the callback to record a null for each missing column. Only the possible matches reach the metadata reader.
Example
Suppose an aligned query requests
temperatureandpressureon a cold cache. The file containstemperature, and its Bloom filter rules outpressure. Previously IoTDB probed the two full paths individually after the time-column check. It now makes one batch call with both names. The reader loads the time column andtemperature. The result still has a null entry forpressure, and a later query can probe it again without occupying a negative cache entry.Verification
TimeSeriesMetadataCacheTest,AlignedSeriesScanBatchTest, andReadPointAlignedCrossCompactionTestagainst2.5.1-261203-SNAPSHOT. 39 tests passed, and one existing performance test was skipped.2.5.1-261203-20261203.101004-3from the merge of TsFile [IOTDB-661] Keep the alias column in result if it's used in query #1183. All 1,060 class files in the published TsFile JAR match the locally tested merge build. Maven metadata · TsFile merge commitThis PR continues #19509 from a branch in
apache/iotdbso same-repository CI can run. The original review discussion remains on #19509.