Pengzna commented on code in PR #16303:
URL: https://github.com/apache/iotdb/pull/16303#discussion_r2532764800


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/CompletedProcedureRecycler.java:
##########
@@ -70,15 +70,30 @@ protected void periodicExecute(final Env env) {
         // Failed procedures aren't persisted in WAL.
         batchIds[batchCount++] = entry.getKey();
         if (batchCount == batchIds.length) {
-          store.delete(batchIds, 0, batchCount);
-          batchCount = 0;
+          try {
+            store.delete(batchIds, 0, batchCount);
+          } catch (Exception e) {
+            LOG.error("Error deleting completed procedures {}.", proc, e);
+            // Do not remove from the completed map. Even this procedure may 
be restored
+            // unexpectedly in another new CN leader, we do not need to do 
anything else since
+            // procedures are idempotency.

Review Comment:
   fixed



##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java:
##########
@@ -477,7 +479,11 @@ private void countDownChildren(RootProcedureStack 
rootProcStack, Procedure<Env>
     }
     if (parent != null && parent.tryRunnable()) {
       // If success, means all its children have completed, move parent to 
front of the queue.
-      store.update(parent);
+      // Must endless retry here, since this step is not idempotency and can 
not be reexecute

Review Comment:
   fied



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