ChenSammi commented on code in PR #3403:
URL: https://github.com/apache/ozone/pull/3403#discussion_r870894580


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java:
##########
@@ -133,6 +133,15 @@ public CompletableFuture<Message> applyTransaction(
       final TransactionContext trx) {
     final CompletableFuture<Message> applyTransactionFuture =
         new CompletableFuture<>();
+    if (getLifeCycleState().isPausingOrPaused()) {
+      // Statemachine is installation snapshot. Discard any request.

Review Comment:
   Ratis will call StateMachine#pause before snapshot install, and then call 
StateMachine#reinitialize after statemachine reloaded.  In SCM 
StateMachine#reinitialize, the statemachine will turn itself into RUNNING 
state.  All this happens concurrently with Ratis StateMachineUpdater which call 
ApplyTransaction.  So we need to check the statemachine state in 
applyTransaction.  Refer to following crash stack. 
   
   
![image](https://user-images.githubusercontent.com/19790142/167980105-4dd9edc5-f305-478c-9025-a0267d8fd6bd.png)
   
   
   In OM statemachine implementation, we don't check this statemachine state in 
applyTransaction. Because all transaction output data go into OMDoubleBuffer, 
and we stop OMDoubleBuffer before we reload DB, and restart OMDoubleBuffer 
after that. 
   



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