Skip to content

Fix downgraded TsFileResource serialization#18157

Open
jt2594838 wants to merge 1 commit into
dev/1.3from
fix_serialization_of_downgraded_resource_dev_1.3
Open

Fix downgraded TsFileResource serialization#18157
jt2594838 wants to merge 1 commit into
dev/1.3from
fix_serialization_of_downgraded_resource_dev_1.3

Conversation

@jt2594838

Copy link
Copy Markdown
Contributor

Description

This PR backports the fix for serializing a TsFileResource whose in-memory TimeIndex has been degraded to FileTimeIndex.

When serializing a degraded resource and the .resource file still exists, TsFileResource now rebuilds a device time index through buildDeviceTimeIndex() for serialization instead of serializing FileTimeIndex directly.

It also adds coverage for region migration after TimeIndex degradation in an existing cluster IT class to avoid introducing another cluster restart path.

Tests

  • mvn spotless:apply -pl iotdb-core/datanode
  • mvn spotless:apply -pl integration-test -P with-integration-tests
  • mvn test -pl iotdb-core/datanode -Dtest=TsFileResourceTest (blocked: local dev/1.3 snapshot dependencies are not available without -am)
  • mvn test -pl iotdb-core/datanode -am -Dtest=TsFileResourceTest '-Dsurefire.failIfNoSpecifiedTests=false' (blocked before datanode tests by generated thrift compilation errors: TProtocol.incrementRecursionDepth/decrementRecursionDepth not found in iotdb-thrift-commons)

@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.31%. Comparing base (46badda) to head (7cb14e6).
⚠️ Report is 3 commits behind head on dev/1.3.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev/1.3   #18157      +/-   ##
=============================================
+ Coverage      43.24%   43.31%   +0.06%     
  Complexity       198      198              
=============================================
  Files           3628     3629       +1     
  Lines         243018   243434     +416     
  Branches       29637    29696      +59     
=============================================
+ Hits          105091   105438     +347     
- Misses        137927   137996      +69     

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

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.

2 participants