You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Caideyipi (via GitHub)" <gi...@apache.org> on 2026/07/27 07:22:39 UTC

[PR] [Pipe] Fix historical TsFile schema recovery race [iotdb]

Caideyipi opened a new pull request, #18314:
URL: https://github.com/apache/iotdb/pull/18314

   ## 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 reported screenshots show this timing-dependent failure:
   
   - The replicated data and all three expected devices are already visible on the receiver.
   - `SHOW PATHS SET DEVICE TEMPLATE aligned_template` does not return the expected `root.sg_aligned.device_aligned`.
   - The receiver log reports that setting `aligned_template` on `root.sg_aligned.device_aligned` failed 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
   
   - Mark a TsFile transfer as requiring schema readiness only when all of the following are true:
     - the source is the built-in IoTDB source;
     - the sink sends a Pipe request rather than a general write request;
     - the inclusion options contain all schema events required before loading data: ordinary timeseries creation and template create/alter/set/activate.
   - Carry this marker in V2 TsFile seal parameters through synchronous Thrift, asynchronous Thrift, and AirGap sinks.
   - For a marked transfer, force schema verification and disable schema auto-creation for that individual load.
   - Treat missing schema as temporary unavailability so Pipe retries the TsFile after the corresponding schema/template events arrive.
   - Preserve the per-load option through the Active Load path used by asynchronous loading.
   - Verify existing schema under the schema-deletion read lock to avoid racing with deletion while auto-creation is disabled.
   
   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 ordinary `LOAD TSFILE` operations. The existing default that permits per-load schema auto-creation also remains unchanged unless the receiver gets the new marker.
   
   ### Tests
   
   - Added focused unit coverage for parameter gating, V2 request serialization, synchronous/asynchronous receiver configuration, retry classification, and Active Load attribute persistence.
   - Extended `IoTDBPipeAutoConflictIT` to assert that `root.sg_aligned.device_aligned` is bound to `aligned_template` on the receiver.
   - Focused test run: `OK (76 tests)` across 6 test classes.
   - Spotless, whitespace checks, and isolated compilation of the affected sources passed.
   - A full local Maven/IT run could not reach the target IT because this checkout has unrelated stale Freemarker-generated sources and an incompatible `template-node` artifact.
   
   <hr>
   
   This PR has:
   
   - [x] been self-reviewed.
     - [x] concurrent write
   - [x] added comments explaining non-obvious intent.
   - [x] added or updated unit tests for the new code paths.
   - [x] updated integration-test coverage.
   
   <hr>
   
   ##### 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.
   - `PipeTransferTsFileSealWithModReq` and 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`, and `SchemaValidator`: support per-load schema auto-creation control and retryable missing-schema handling.
   - Active Load helpers/configuration: persist the per-load option across asynchronous handoff.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Pipe] Fix historical TsFile schema recovery race [iotdb]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 merged PR #18314:
URL: https://github.com/apache/iotdb/pull/18314


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Pipe] Fix historical TsFile schema recovery race [iotdb]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #18314:
URL: https://github.com/apache/iotdb/pull/18314#issuecomment-5088913639

   ## [Codecov](https://app.codecov.io/gh/apache/iotdb/pull/18314?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `61.65414%` with `51 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 42.93%. Comparing base ([`892dbd8`](https://app.codecov.io/gh/apache/iotdb/commit/892dbd85bab4d665b4873b1e354f36e22d5e033a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4cc75a8`](https://app.codecov.io/gh/apache/iotdb/commit/4cc75a8e74fc83910c74dc37e9ed2364dce31f9e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iotdb/pull/18314?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...eceiver/protocol/thrift/IoTDBDataNodeReceiver.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Freceiver%2Fprotocol%2Fthrift%2FIoTDBDataNodeReceiver.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9yZWNlaXZlci9wcm90b2NvbC90aHJpZnQvSW9UREJEYXRhTm9kZVJlY2VpdmVyLmphdmE=) | 33.33% | [12 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ueryengine/plan/analyze/schema/ISchemaFetcher.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fanalyze%2Fschema%2FISchemaFetcher.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9hbmFseXplL3NjaGVtYS9JU2NoZW1hRmV0Y2hlci5qYXZh) | 0.00% | [7 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...able/request/PipeTransferTsFileSealWithModReq.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Fsink%2Fpayload%2Fevolvable%2Frequest%2FPipeTransferTsFileSealWithModReq.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9zaW5rL3BheWxvYWQvZXZvbHZhYmxlL3JlcXVlc3QvUGlwZVRyYW5zZmVyVHNGaWxlU2VhbFdpdGhNb2RSZXEuamF2YQ==) | 66.66% | [5 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ink/protocol/airgap/IoTDBDataRegionAirGapSink.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Fsink%2Fprotocol%2Fairgap%2FIoTDBDataRegionAirGapSink.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9zaW5rL3Byb3RvY29sL2FpcmdhcC9Jb1REQkRhdGFSZWdpb25BaXJHYXBTaW5rLmphdmE=) | 20.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...hrift/async/handler/PipeTransferTsFileHandler.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Fsink%2Fprotocol%2Fthrift%2Fasync%2Fhandler%2FPipeTransferTsFileHandler.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9zaW5rL3Byb3RvY29sL3RocmlmdC9hc3luYy9oYW5kbGVyL1BpcGVUcmFuc2ZlclRzRmlsZUhhbmRsZXIuamF2YQ==) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...eryengine/plan/analyze/schema/SchemaValidator.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fanalyze%2Fschema%2FSchemaValidator.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9hbmFseXplL3NjaGVtYS9TY2hlbWFWYWxpZGF0b3IuamF2YQ==) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...pe/agent/task/builder/PipeDataNodeTaskBuilder.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Fagent%2Ftask%2Fbuilder%2FPipeDataNodeTaskBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9hZ2VudC90YXNrL2J1aWxkZXIvUGlwZURhdGFOb2RlVGFza0J1aWxkZXIuamF2YQ==) | 88.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ngine/plan/statement/crud/LoadTsFileStatement.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fstatement%2Fcrud%2FLoadTsFileStatement.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9zdGF0ZW1lbnQvY3J1ZC9Mb2FkVHNGaWxlU3RhdGVtZW50LmphdmE=) | 70.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [.../protocol/thrift/sync/IoTDBDataRegionSyncSink.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fpipe%2Fsink%2Fprotocol%2Fthrift%2Fsync%2FIoTDBDataRegionSyncSink.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcGlwZS9zaW5rL3Byb3RvY29sL3RocmlmdC9zeW5jL0lvVERCRGF0YVJlZ2lvblN5bmNTaW5rLmphdmE=) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ryengine/plan/analyze/load/LoadTsFileAnalyzer.java](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fanalyze%2Fload%2FLoadTsFileAnalyzer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9hbmFseXplL2xvYWQvTG9hZFRzRmlsZUFuYWx5emVyLmphdmE=) | 81.81% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | ... and [4 more](https://app.codecov.io/gh/apache/iotdb/pull/18314?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18314      +/-   ##
   ============================================
   - Coverage     43.10%   42.93%   -0.17%     
     Complexity      374      374              
   ============================================
     Files          5362     5363       +1     
     Lines        381676   381774      +98     
     Branches      49568    49585      +17     
   ============================================
   - Hits         164504   163903     -601     
   - Misses       217172   217871     +699     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/iotdb/pull/18314?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Pipe] Fix historical TsFile schema recovery race [iotdb]

Posted by "jt2594838 (via GitHub)" <gi...@apache.org>.
jt2594838 commented on code in PR #18314:
URL: https://github.com/apache/iotdb/pull/18314#discussion_r3656366656


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/ISchemaFetcher.java:
##########
@@ -121,6 +123,21 @@ ISchemaTree fetchSchemaListWithAutoCreate(
       List<Boolean> aligned,
       MPPQueryContext context);
 
+  default ISchemaTree fetchSchemaList(
+      final List<PartialPath> devicePaths,
+      final List<String[]> measurementsList,
+      final MPPQueryContext context) {
+    DataNodeSchemaLockManager.getInstance()
+        .takeReadLock(context, SchemaLockType.VALIDATE_VS_DELETION_TREE);
+    final PathPatternTree patternTree = new PathPatternTree();
+    for (int i = 0; i < devicePaths.size(); i++) {
+      for (final String measurement : measurementsList.get(i)) {
+        patternTree.appendFullPath(devicePaths.get(i), measurement);
+      }
+    }
+    return fetchSchema(patternTree, true, context, true);
+  }

Review Comment:
   Where is the lock released?
   Add a comment.



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java:
##########
@@ -114,6 +114,8 @@ public class LoadTsFileAnalyzer implements AutoCloseable {
   private String databaseForTableData;
   private final boolean isAsyncLoad;
   private final boolean isVerifySchema;
+  private final boolean isAutoCreateSchemaAllowed;
+  private final boolean isAutoCreateSchema;

Review Comment:
   Too confusing, give better names.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Pipe] Fix historical TsFile schema recovery race [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #18314:
URL: https://github.com/apache/iotdb/pull/18314#issuecomment-5088570997

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18314) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [E Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18314) (required ≥ A)  
     
   <!-- sqra:qg_revision=194bace53cf02dfb2fb7868e1c4e453120980cc768e405a288e5776389b40b0e -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18314)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Pipe] Fix historical TsFile schema recovery race [iotdb]

Posted by "Caideyipi (via GitHub)" <gi...@apache.org>.
Caideyipi commented on code in PR #18314:
URL: https://github.com/apache/iotdb/pull/18314#discussion_r3680478954


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java:
##########
@@ -114,6 +114,8 @@ public class LoadTsFileAnalyzer implements AutoCloseable {
   private String databaseForTableData;
   private final boolean isAsyncLoad;
   private final boolean isVerifySchema;
+  private final boolean isAutoCreateSchemaAllowed;
+  private final boolean isAutoCreateSchema;

Review Comment:
   Renamed the two states in 4ee2fbef3b4: isAutoCreateSchemaRequested is the statement/attribute request, while isAutoCreateSchemaEnabled is the effective local setting after applying the server config. The related accessors and tests now use the same distinction.



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/ISchemaFetcher.java:
##########
@@ -121,6 +123,21 @@ ISchemaTree fetchSchemaListWithAutoCreate(
       List<Boolean> aligned,
       MPPQueryContext context);
 
+  default ISchemaTree fetchSchemaList(
+      final List<PartialPath> devicePaths,
+      final List<String[]> measurementsList,
+      final MPPQueryContext context) {
+    DataNodeSchemaLockManager.getInstance()
+        .takeReadLock(context, SchemaLockType.VALIDATE_VS_DELETION_TREE);
+    final PathPatternTree patternTree = new PathPatternTree();
+    for (int i = 0; i < devicePaths.size(); i++) {
+      for (final String measurement : measurementsList.get(i)) {
+        patternTree.appendFullPath(devicePaths.get(i), measurement);
+      }
+    }
+    return fetchSchema(patternTree, true, context, true);
+  }

Review Comment:
   Added the lifecycle comment in 4ee2fbef3b4. The lock is recorded in MPPQueryContext and intentionally remains held through execution; Coordinator releases the recorded schema read locks from its finally block. The focused LoadTsFileAnalyzerTest suite passes (7 tests).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Pipe] Fix historical TsFile schema recovery race [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #18314:
URL: https://github.com/apache/iotdb/pull/18314#issuecomment-5127454369

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18314) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18314) (required ≥ A)  
     
   <!-- sqra:qg_revision=f126844a06ede42e4c80ba77e9c63dd00b37fd384c1bb4432786bdb8416d20f5 -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18314)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org