Skip to content

[IT] Scale the DataNode heap with the CPU cores in IoTDBMultiTAGsWithAttributesTableIT - #19086

Open
chrisdutz wants to merge 1 commit into
masterfrom
fix/it-multitags-scale-heap
Open

chrisdutz wants to merge 1 commit into
masterfrom
fix/it-multitags-scale-heap

Conversation

@chrisdutz

Copy link
Copy Markdown
Contributor

Description

Problem

On machines with many CPU cores, IoTDBMultiTAGsWithAttributesTableIT.fourTableJoinTest fails every time:

719: There is not enough memory to execute current fragment instance, current remaining free memory is 155701B, estimated memory usage for current fragment instance is 1058088B

It passes on CI.

Cause

The test runs with the default AUTO DataRegionGroup extension policy, so the number of DataRegionGroups follows the CPU cores of the DataNodes (data_region_per_data_node_proportion = 0.5). The fragment instances of the four-table join grow with it, and many of them reserve about 1 MB of operator memory because the test sets a 1 MB sort buffer. The DataNode heap stays at 256 MB, which gives about 16 MB of operator memory:

Cores DataRegionGroups Fragment instances of fourTableJoinTest Fits into 16 MB
4 (CI runner) 2 few yes
12 (my machine) 6 25 no, needs about 21 MB

Limiting the DataNode JVMs to 4 cores (-XX:ActiveProcessorCount=4) on the same machine gives 2 regions, and all 34 test cases pass.

Fix

Scale the DataNode heap with the expected number of DataRegions instead of limiting the regions, so that a machine with more cores still runs the test with all of them: 128 MB per region (availableProcessors() / 2), but never less than the configured heap (DataNodeMaxHeapSize, default 256 MB). The test needs about 3.5 MB of operator memory per region, so this leaves a margin of about 2x.

On a 4-core machine the result is the default 256 MB, so CI runs with the same settings as before.

Verification

IoTDBMultiTAGsWithAttributesTableIT alone, on macOS with 12 cores:

Setup DataNode heap Regions Result
master 256 MB 6 fourTableJoinTest fails in every run
this change, TableSimpleIT, 5 runs 768 MB 6 34 of 34 pass in every run
this change, TableSimpleIT, JVMs limited to 4 cores 256 MB 2 34 of 34 pass
this change, TableClusterIT (1C3D) 768 MB 18 in total 34 of 34 pass

spotless:check passes for integration-test.


This PR has:

  • been self-reviewed.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.

Key changed/added classes (or packages if there are too many classes) in this PR
  • integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBMultiTAGsWithAttributesTableIT.java

🤖 Generated with Claude Code

…AttributesTableIT

With the default AUTO extension policy, the number of DataRegionGroups
follows the CPU cores of the DataNodes (0.5 per core): 2 on a 4-core CI
runner, 6 on a 12-core machine. The number of fragment instances of
fourTableJoinTest grows with it, and many of them reserve about 1 MB of
operator memory because of the 1 MB sort buffer the test sets.

The DataNode heap doesn't grow with it. With 6 regions, the 25 fragment
instances don't fit into the about 16 MB of operator memory of a 256 MB
heap, and the test fails with "There is not enough memory to execute
current fragment instance".

Give the test DataNodes 128 MB of heap per expected DataRegion, but
never less than the configured heap. On a 4-core machine this is the
default 256 MB, so CI runs with the same settings as before.
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.12%. Comparing base (999721f) to head (095124b).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##             master   #19086     +/-   ##
===========================================
  Coverage     48.11%   48.12%             
- Complexity      621      625      +4     
===========================================
  Files          5572     5572             
  Lines        410286   411548   +1262     
  Branches      54129    54190     +61     
===========================================
+ Hits         197408   198052    +644     
- Misses       212878   213496    +618     

☔ 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.

@chrisdutz

Copy link
Copy Markdown
Contributor Author

The failing SonarCloud quality gate is not caused by this change. Its only bug finding is S3078 ("Use an AtomicBoolean") in iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/pipe/PipeTaskInfo.java:1174, which this PR does not touch. The file was changed by #19066, which is part of this branch's base but newer than SonarCloud's last master analysis (2026-10-31, 26cbf0f), so SonarCloud counts it as new code here. Other current PRs against master fail the same gate for the same reason.

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.

1 participant