Skip to content

Fix relational insert tablet redirect row count - #19221

Merged
jt2594838 merged 1 commit into
masterfrom
fix-insert-tablet-effective-row-count
Nov 11, 2026
Merged

jt2594838 merged 1 commit into
masterfrom
fix-insert-tablet-effective-row-count

Conversation

@shuwenwei

Copy link
Copy Markdown
Member

Summary

  • Use the tablet effective rowCount when constructing table-model redirect endpoints.
  • Add a regression test with spare backing-array capacity beyond the valid rows.

Problem

Tablet backing arrays may contain more slots than the number of valid rows represented by rowCount. RelationalInsertTabletNode.splitByReplicaSet() iterated over times.length, while device IDs are computed for rowCount rows. This could process rows outside the valid range and throw ArrayIndexOutOfBoundsException during write planning.

Fix

Build the redirect node list using rowCount, matching the rows that are actually part of the tablet.

Example

Before: a relational tablet with rowCount = 2 and four timestamp slots could fail with ArrayIndexOutOfBoundsException during redirect construction.
After: only the two valid rows produce redirect entries and planning completes normally.

Validation

  • Ran ./mvnw spotless:apply -pl iotdb-core/datanode.
  • Tests and compilation were not run locally; CI will validate them.

@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

@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.89%. Comparing base (509c395) to head (b3d4c5f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #19221      +/-   ##
============================================
- Coverage     48.89%   48.89%   -0.01%     
  Complexity      689      689              
============================================
  Files          5588     5588              
  Lines        413407   413407              
  Branches      54526    54526              
============================================
- Hits         202120   202116       -4     
- Misses       211287   211291       +4     

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

@jt2594838
jt2594838 merged commit 6e7448d into master Nov 11, 2026
41 of 42 checks passed
@jt2594838
jt2594838 deleted the fix-insert-tablet-effective-row-count branch November 11, 2026 08:30
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