Skip to content

Fix time partition boundary overflow handling#17893

Open
Caideyipi wants to merge 6 commits into
masterfrom
time-partition-boundary-overflow-fix
Open

Fix time partition boundary overflow handling#17893
Caideyipi wants to merge 6 commits into
masterfrom
time-partition-boundary-overflow-fix

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

This patch fixes overflow-prone time partition boundary handling by making partition boundary calculations origin-aware and saturation-safe.

The main changes are:

  • keep time partition origin/interval boundary state in TimePartitionUtils
  • make partition start-time lookup and partition-start checks overflow-safe
  • cap partition estimate calculations instead of overflowing
  • use saturated arithmetic in TTL auto-clean partition boundary checks
  • refresh partition boundary origin from storage engine configuration
  • update related query and pipe realtime paths to use the shared boundary helper

Tests

  • mvn -pl iotdb-core/node-commons -DskipTests compile
  • mvn -pl iotdb-core/node-commons test currently fails during testCompile because CommitProgressKeeperTest references missing RegionProgress, WriterId, and WriterProgress symbols, which is unrelated to this change.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.55%. Comparing base (c3e74a2) to head (8acf656).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...apache/iotdb/commons/utils/TimePartitionUtils.java 95.12% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #17893   +/-   ##
=========================================
  Coverage     40.54%   40.55%           
+ Complexity     2622     2620    -2     
=========================================
  Files          5244     5244           
  Lines        362367   362390   +23     
  Branches      46651    46659    +8     
=========================================
+ Hits         146938   146981   +43     
+ Misses       215429   215409   -20     

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

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B 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

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