Skip to content

Support serializing plain device time index#17285

Open
shuwenwei wants to merge 1 commit intomasterfrom
serializePlainDeviceTimeIndex
Open

Support serializing plain device time index#17285
shuwenwei wants to merge 1 commit intomasterfrom
serializePlainDeviceTimeIndex

Conversation

@shuwenwei
Copy link
Member

Description

Support serializing plain device time index

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.69%. Comparing base (0012727) to head (d0aa2cf).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17285      +/-   ##
============================================
- Coverage     39.70%   39.69%   -0.01%     
  Complexity      282      282              
============================================
  Files          5100     5100              
  Lines        341950   341966      +16     
  Branches      43559    43560       +1     
============================================
- Hits         135769   135747      -22     
- Misses       206181   206219      +38     

☔ View full report in Codecov by Sentry.
📢 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.

@HTHou HTHou requested a review from Copilot March 11, 2026 14:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates time index serialization behavior to migrate legacy (plain) device time indexes into the newer array-based format when writing resources, and adds a regression test to validate repairing/moving an old-version resource file results in an ArrayDeviceTimeIndex.

Changes:

  • Add a compaction repair test that loads a v3 tsfile + legacy resource file and validates the repaired resource uses ARRAY_DEVICE_TIME_INDEX_TYPE.
  • Remove PlainDeviceTimeIndex’s unsupported serialize override so it can be written using the array-format serializer.
  • Adjust ArrayDeviceTimeIndex.serialize to always write the array time index type marker.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/compaction/repair/RepairUnsortedFileCompactionTest.java Adds coverage for repairing/moving an old-version resource and asserting time index type migration to array format.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/timeindex/PlainDeviceTimeIndex.java Enables serialization (via inherited serializer) by removing the previous UnsupportedOperationException serialize override.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/timeindex/ArrayDeviceTimeIndex.java Forces serialized time index type marker to ARRAY_DEVICE_TIME_INDEX_TYPE to support migration-on-write behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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