You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/04/27 07:41:30 UTC

[GitHub] [incubator-ratis] runzhiwang opened a new pull request #64: RATIS-883. Fix Failed UT: testStateMachineMetrics.checkFollowerCommitLagsLeader

runzhiwang opened a new pull request #64:
URL: https://github.com/apache/incubator-ratis/pull/64


   **What's the problem ?**
   ![image](https://user-images.githubusercontent.com/51938049/80346497-6db45800-889d-11ea-80c8-4ac8842f4dc0.png)
   
   **What's the reason ?**
   The reason is follower update commitInfoCache after leader.
   
   The stack of follower update commitInfoCache is: 
   RaftServerImpl::appendEntriesAsync
   -> state.updateStateMachine 
   -> StateMachineUpdater::applyLog 
   -> RaftServerImpl::applyLogToStateMachine
   -> RaftServerImpl::replyPendingRequest 
   -> RaftServerImpl::getCommitInfos 
   -> infos.add(commitInfoCache.update(getPeer(), state.getLog().getLastCommittedIndex())) 
   -> CommitInfoCache::update.
   
   The stack of leader update commitInfoCache is: 
   follower finish RaftServerImpl::appendEntriesAsync and return reply
   -> GrpcLogAppender::runAppenderImpl 
   -> GrpcLogAppender::appendLog 
   ->LogAppender::createRequest 
   ->LeaderState::newAppendEntriesRequestProto 
   ->RaftServerImpl::getCommitInfos 
   ->LeaderState::updateFollowerCommitInfos
   ->CommitInfoCache::update.
   
   Because follower need to notify thread StateMachineUpdater to update CommitInfoCache, we can not ensure follower update CommitInfoCache before leader.
   
   **How to fix ?**
   Follower update CommitInfoCache before return reply to leader.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-ratis] lokeshj1703 closed pull request #64: RATIS-883. Fix Failed UT: testStateMachineMetrics.checkFollowerCommitLagsLeader

Posted by GitBox <gi...@apache.org>.
lokeshj1703 closed pull request #64:
URL: https://github.com/apache/incubator-ratis/pull/64


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-ratis] lokeshj1703 commented on pull request #64: RATIS-883. Fix Failed UT: testStateMachineMetrics.checkFollowerCommitLagsLeader

Posted by GitBox <gi...@apache.org>.
lokeshj1703 commented on pull request #64:
URL: https://github.com/apache/incubator-ratis/pull/64#issuecomment-629960932


   @runzhiwang Thanks for the contribution! I have committed the PR to master branch.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-ratis] runzhiwang commented on pull request #64: RATIS-883. Fix Failed UT: testStateMachineMetrics.checkFollowerCommitLagsLeader

Posted by GitBox <gi...@apache.org>.
runzhiwang commented on pull request #64:
URL: https://github.com/apache/incubator-ratis/pull/64#issuecomment-626417437


   @lokeshj1703 Could you help review this patch ? Thank you very much.


----------------------------------------------------------------
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:
users@infra.apache.org