sumitagrawl commented on code in PR #6928:
URL: https://github.com/apache/ozone/pull/6928#discussion_r1677645226


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java:
##########
@@ -287,6 +301,11 @@ public TransactionContext 
preAppendTransaction(TransactionContext trx)
     final OMRequest request = (OMRequest) trx.getStateMachineContext();
     OzoneManagerProtocolProtos.Type cmdType = request.getCmdType();
 
+    if (readonlyMode.get()) {

Review Comment:
   1. startTransaction() is called out of synchronized lock by ratis. On 
exception, it return exception to client.
   2. preAppend Transaction() is called after having synchronized lock, and 
with success, create log entry and sync to all node in ratis ring. On 
Exception, it also causes dropping itself as leader as logic.
   
   - startTransaction() check immediately return failure.
   - preAppend() check is to avoid continue of already triggered request 
waiting on lock. This is for those request waiting for previous request to 
complete.
   
   So added both places for user request.
   



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