imbajin commented on code in PR #2871:
URL: https://github.com/apache/hugegraph/pull/2871#discussion_r4098105266


##########
hugegraph-store/hg-store-core/src/main/java/org/apache/hugegraph/store/raft/PartitionStateMachine.java:
##########
@@ -105,6 +105,9 @@ public void onApply(Iterator iter) {
                               done.getOperation().getOp(),
                               done.getOperation().getReq());
                 }
+                iter.setErrorAndRollback(1, new 
Status(RaftError.ESTATEMACHINE, t.getMessage()));

Review Comment:
   ⚠️ This catch also covers `done.run(Status.OK())` in the leader path. The 
`Change_Shard` handler updates its task and starts follow-up work before 
invoking the response closure, so a thrown callback is treated as an apply 
failure after side effects have started and can fail-stop this FSM. Please keep 
callback exceptions out of the rollback path.



##########
hugegraph-store/hg-store-core/src/main/java/org/apache/hugegraph/store/raft/PartitionStateMachine.java:
##########
@@ -105,6 +105,9 @@ public void onApply(Iterator iter) {
                               done.getOperation().getOp(),
                               done.getOperation().getReq());
                 }
+                iter.setErrorAndRollback(1, new 
Status(RaftError.ESTATEMACHINE, t.getMessage()));

Review Comment:
   ⚠️ This records a terminal state-machine error for the committed entry, but 
`PartitionEngine.onError()` immediately restarts the engine; `shutdown()` keeps 
the same log/meta directories that `init()` reopens. A deterministic failure 
will replay the entry and restart again, leaving the partition unavailable. 
Please stop automatic restart for this error or add bounded recovery that does 
not replay the poison entry.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to