Skip to content

Batch Bloom filter probes for aligned metadata cache misses - #19514

Merged
JackieTien97 merged 6 commits into
masterfrom
perf/batch-bloom-metadata-cache
Dec 3, 2026
Merged

JackieTien97 merged 6 commits into
masterfrom
perf/batch-bloom-metadata-cache

Conversation

@ColinLeeo

@ColinLeeo ColinLeeo commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

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 temperature and pressure on a cold cache. The file contains temperature, and its Bloom filter rules out pressure. 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 and temperature. The result still has a null entry for pressure, and a later query can probe it again without occupying a negative cache entry.

Verification

  • Ran TimeSeriesMetadataCacheTest, AlignedSeriesScanBatchTest, and ReadPointAlignedCrossCompactionTest against 2.5.1-261203-SNAPSHOT. 39 tests passed, and one existing performance test was skipped.
  • Verified the Apache snapshot build 2.5.1-261203-20261203.101004-3 from 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 commit
  • Compiled the full reactor with the English and Chinese locales.
  • Built the standard and Edge distributions and verified the embedded TsFile JAR in both ZIPs.

This PR continues #19509 from a branch in apache/iotdb so same-repository CI can run. The original review discussion remains on #19509.

@ColinLeeo
ColinLeeo requested a max review from Copilot December 3, 2026 04:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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 TimeSeriesMetadataCache from per-measurement Bloom checks to removeNotExistingMeasurements(...) 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

Comment thread pom.xml Resolved
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.92%. Comparing base (493b386) to head (08f9910).
⚠️ Report is 16 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ColinLeeo
ColinLeeo requested a max review from Copilot December 3, 2026 09:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Review effort: Lite

Comment thread pom.xml Outdated
<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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version should be changed to 2.5.1-261203-SNAPSHOT

@ColinLeeo
ColinLeeo requested a max review from Copilot December 3, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +577 to +585
// 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("");
}
@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

@JackieTien97
JackieTien97 merged commit 9cfd7ab into master Dec 3, 2026
51 of 52 checks passed
@JackieTien97
JackieTien97 deleted the perf/batch-bloom-metadata-cache branch December 3, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants