Repository navigation
[Pipe] Fix historical TsFile schema recovery race - #18314
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18314 +/- ##
============================================
+ Coverage 43.10% 43.41% +0.31%
Complexity 374 374
============================================
Files 5362 5367 +5
Lines 381676 383057 +1381
Branches 49568 49827 +259
============================================
+ Hits 164504 166288 +1784
+ Misses 217172 216769 -403 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jt2594838
reviewed
Jul 27, 2026
|
3 tasks done
jt2594838
pushed a commit
that referenced
this pull request
Aug 3, 2026
VGalaxies
pushed a commit
to VGalaxies/iotdb
that referenced
this pull request
Oct 26, 2026
* [Pipe] Fix historical TsFile schema recovery race * Clarify load schema creation and lock lifecycle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Description
Problem and observed behavior
Historical Pipe events from ConfigRegion, SchemaRegion, and DataRegion are transferred independently. A historical TsFile can therefore reach the receiver before the schema and template events that describe it, making the result dependent on event arrival order.
The timing-dependent failure is as follows:
SHOW PATHS SET DEVICE TEMPLATE aligned_templatedoes not return the expectedroot.sg_aligned.device_aligned.aligned_templateonroot.sg_aligned.device_alignedfailed because ordinary timeseries had already been created under that path.The early TsFile load auto-creates ordinary timeseries. When the historical template-set event arrives later, it conflicts with those timeseries and the receiver cannot restore the original template binding.
Fix
This avoids imposing cross-region transfer ordering: data loading simply waits and retries until the schema history has been applied.
Compatibility
The new behavior is opt-in through an internal system parameter and defaults to disabled on the wire. Existing behavior is preserved for external sources, incomplete schema inclusion, general-write requests,
mark-as-pipe-request=false, legacy requests, and ordinaryLOAD TSFILEoperations. The existing default that permits per-load schema auto-creation also remains unchanged unless the receiver gets the new marker.Tests
IoTDBPipeAutoConflictITto assert thatroot.sg_aligned.device_alignedis bound toaligned_templateon the receiver.OK (76 tests)across 6 test classes.template-nodeartifact.This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
PipeDataNodeTaskBuilder: determines whether a Pipe has complete schema history and injects the internal wait marker.PipeTransferTsFileSealWithModReqand DataRegion sinks: propagate the marker across all V2 transfer paths.IoTDBDataNodeReceiver: configures marked sync and async loads to verify without auto-creating schema.LoadTsFileAnalyzer,TreeSchemaAutoCreatorAndVerifier, andSchemaValidator: support per-load schema auto-creation control and retryable missing-schema handling.