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


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/Procedure.java:
##########
@@ -314,10 +318,16 @@ public final ProcedureLockState doAcquireLock(Env env, 
IProcedureStore store) {
    */
   public final void doReleaseLock(Env env, IProcedureStore store) {
     locked = false;
-    if (getState() != ProcedureState.ROLLEDBACK) {
+    if (getState() == ProcedureState.ROLLEDBACK) {
+      LOG.info("Force write unlock state to raft for pid={}", this.procId);
+    }
+    try {
       store.update(this);
+      // do not release lock when consensus layer is not working
+      releaseLock(env);
+    } catch (Exception e) {

Review Comment:
   Who will release the lock then?



##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/ProcedureExecutor.java:
##########
@@ -477,12 +477,17 @@ 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);
-      scheduler.addFront(parent);
-      LOG.info(
-          "Finished subprocedure pid={}, resume processing ppid={}",
-          proc.getProcId(),
-          parent.getProcId());
+      try {
+        store.update(parent);
+        // do not add this procedure when exception occurred
+        scheduler.addFront(parent);
+        LOG.info(
+            "Finished subprocedure pid={}, resume processing ppid={}",
+            proc.getProcId(),
+            parent.getProcId());
+      } catch (Exception e) {
+        LOG.warn("Failed to update parent on countdown", e);
+      }

Review Comment:
   Is solely printing a log enough?



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