lokeshj1703 opened a new pull request #1690:
URL: https://github.com/apache/ozone/pull/1690


   ## What changes were proposed in this pull request?
   
   On restart the transactions are reapplied for an existing ratis pipeline. 
ContainerStateMachine#applyTransaction while processing future can throw 
NullPointerException leading to the future being completed exceptionally.
   ```
         future.thenApply(r -> {
           if (trx.getServerRole() == RaftPeerRole.LEADER) {
             long startTime = (long) trx.getStateMachineContext();
             metrics.incPipelineLatency(cmdType,
                 Time.monotonicNowNanos() - startTime);
           }
   ```
   In the above code snippet trx.getStateMachineContext() will be null during 
restart and this fails the future itself without updating the 
applyTransactionCompletionMap. As a result the lastAppliedIndex is not updated 
for the server and server is stuck in leader not ready state.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4580
   
   ## How was this patch tested?
   
   Existing UT
   


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

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