VGalaxies commented on code in PR #11532:
URL: https://github.com/apache/iotdb/pull/11532#discussion_r1392360996


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/runtime/PipeMetaSyncer.java:
##########
@@ -104,16 +117,39 @@ private synchronized void sync() {
       pipeAutoRestartRoundCounter.set(0);
     }
 
-    final TSStatus status = procedureManager.pipeMetaSync();
+    final TSStatus metaSyncStatus = procedureManager.pipeMetaSync();
 
     if (somePipesNeedRestarting
-        && status.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-      handleSuccessfulRestartWithLock();
-      procedureManager.pipeHandleMetaChange(true, false);
+        && metaSyncStatus.getCode() == 
TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      final boolean isRestartSuccessful = handleSuccessfulRestartWithLock();
+      final TSStatus handleMetaChangeStatus =
+          procedureManager.pipeHandleMetaChangeWithBlock(true, false);
+      if (!configManager.getPipeManager().getPipeTaskCoordinator().hasAnyPipe()
+          && isRestartSuccessful
+          && handleMetaChangeStatus.getCode() == 
TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+        LOGGER.info(
+            "set isLastEmptyPipeSyncSuccessful to true, skip next round of 
sync if no pipe");
+        isLastEmptyPipeSyncSuccessful = true;

Review Comment:
   Good catch, I added an extra variable to determine if `PipeTaskInfo` has 
been modified between two empty sync.



-- 
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