You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/03/07 08:07:22 UTC

[GitHub] [ratis] JacksonYao287 opened a new pull request #618: RATIS-1548. use stateMachine#lastAppliedIndex instead of stateMachinUpdater#lastAppliedIndex when checking snapshot should be taken

JacksonYao287 opened a new pull request #618:
URL: https://github.com/apache/ratis/pull/618


   ## What changes were proposed in this pull request?
   
   for now, the following is used to check whether a snapshot should be taken
   
   return state == State.RUNNING && getLastAppliedIndex() - snapshotIndex.get() >= autoSnapshotThreshold; 
   but `getLastAppliedIndex` is the index recorded by stateMachineUpdater, not state machine itself. in some other case (for example, om), the lastAppliedIndex of state machine will not be updated immediately after `applyTransaction` is called . in om , lastAppliedIndex will be updated until the ready queue of double buffer is flushed.
   
   so here `stateMachineUpdater#getLastAppliedIndex()` does not always equal to `stateMachine#lastAppliedIndex`
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/RATIS-1548
   
   ## How was this patch tested?
   
   current 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.

To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ratis] JacksonYao287 commented on pull request #618: RATIS-1548. use stateMachine#lastAppliedIndex instead of stateMachinUpdater#lastAppliedIndex when checking snapshot should be taken

Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #618:
URL: https://github.com/apache/ratis/pull/618#issuecomment-1060500184


   thanks @szetszwo for the review !


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ratis] szetszwo merged pull request #618: RATIS-1548. use stateMachine#lastAppliedIndex instead of stateMachinUpdater#lastAppliedIndex when checking snapshot should be taken

Posted by GitBox <gi...@apache.org>.
szetszwo merged pull request #618:
URL: https://github.com/apache/ratis/pull/618


   


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org