Copilot commented on code in PR #2871:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2871#discussion_r2368395105


##########
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/RaftStateMachine.java:
##########
@@ -94,6 +94,7 @@ public void onApply(Iterator iter) {
                 if (done != null) {
                     done.run(new Status(RaftError.EINTERNAL, t.getMessage()));
                 }
+                iter.setErrorAndRollback(1, new 
Status(RaftError.ESTATEMACHINE, t.getMessage()));

Review Comment:
   [nitpick] The hardcoded rollback count '1' should be extracted as a named 
constant to improve code readability and maintainability. Consider defining a 
constant like 'ROLLBACK_COUNT = 1' to make the intent clearer.



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