Repository navigation
Fix aligned TsFile LOAD data loss - #19371
Conversation
Local Review SummaryReviewed candidate Regression coverage includes duplicate-timestamp fallback that cannot resume without skipping a point. No unresolved findings remain. Validation passed locally: Final local SHA: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #19371 +/- ##
============================================
+ Coverage 49.58% 50.57% +0.98%
+ Complexity 718 129 -589
============================================
Files 5671 5786 +115
Lines 419579 426060 +6481
Branches 55492 56524 +1032
============================================
+ Hits 208066 215471 +7405
+ Misses 211513 210589 -924 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Independent Re-review SummaryReviewed the complete diff from base Validation passed:
Reviewed SHA: The PR remains Draft pending a fresh independent review because this round found and fixed a behavioral issue. Remote CI and Sonar re-analysis were not awaited. |
Independent Re-review SummaryReviewed the complete PR diff from base Local verification passed on the reviewed code: Spotless; the clean DataNode reactor run of The source branch and PR head both match |
|
Review summary (round: re-review)
|
|
Independent review of head Scope covered the changed files in PR order, including the conflicting-type LOAD cases, the historical Pipe regression case, scan and metadata point-count reconciliation, modification handling, timestamp resume boundaries, and failed-fallback behavior that preserves the source TsFile. The PR description reports 26 passing DataNode tests, both added integration tests passing, Spotless, and |
There was a problem hiding this comment.
When the scan fails, is it possible to maintain a heap of ChunkMetadata via the index area, sorted by the chunk offset?
Then we could jump to the next chunk offset and try to resume the scan from it.
This could avoid the complex point counting introduced here.
|
Review-comment handling summary
|
|



Problem
When loading a tree-model TsFile with
convert-on-type-mismatch=true, a scan of an aligned device can emit only part of its data (or no tablets) before reaching normal EOF when target measurement types conflict. Treating that EOF as complete can silently omit points; with delete-after-load enabled, the source file may also be removed.For example, a TsFile with aligned
d.s0andd.s1Boolean values at timestamps 1–4, loaded into existingINT32andINT64series with conversion enabled, must preserve all four timestamps and the converted values for both measurements.Fix
Use per-device and per-measurement point counts from TsFile metadata to identify incomplete scans at EOF. Query fallback recovers the missing data and checks its actual point counts against the expected counts; if recovery is incomplete, LOAD fails instead of reporting success, and the source is retained. Existing type-conversion semantics remain unchanged.
Validation
LoadTreeStatementDataTypeConvertExecutionVisitorTest: 26 tests passed.IoTDBLoadTsFileIT#testLoadWithAllConflictingAlignedDataTypes: passed.IoTDBPipeTypeConversionSemanticIT#testHistoryPipeReceiverTypeConversionForAlignedAllConflicts: passed.git diff --check: passed.