Caideyipi commented on code in PR #16250:
URL: https://github.com/apache/iotdb/pull/16250#discussion_r2303237857


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java:
##########
@@ -2007,6 +2009,77 @@ public SettableFuture<ConfigTaskResult> createPipe(
       return future;
     }
 
+    // Syntactic sugar: if full-sync mode is detected (i.e. not snapshot mode, 
or both realtime
+    // and history are true), the pipe is split into history-only and 
realtime–only modes.
+    final PipeParameters extractorPipeParameters =
+        new PipeParameters(createPipeStatement.getExtractorAttributes());
+    if (PipeConfig.getInstance().getPipeAutoSplitFullEnabled()
+        && PipeDataNodeAgent.task().isFullSync(extractorPipeParameters)) {
+      try (final ConfigNodeClient configNodeClient =
+          
CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+        // 1. Send request to create the historical data synchronization 
pipeline
+        final TCreatePipeReq historyReq =
+            new TCreatePipeReq()
+                // Append suffix to the pipeline name for historical data
+                .setPipeName(createPipeStatement.getPipeName() + "_history")
+                
.setIfNotExistsCondition(createPipeStatement.hasIfNotExistsCondition())

Review Comment:
   I still think we need to handle the situation when the history creation has 
succeeded but realtime has not. Such as, the "if not exists" shall be always 
true, because user may retry the sql when realtime failed, and it's bad to 
return "xx_history already exists" in this situation.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to