You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Mukul Kumar Singh (JIRA)" <ji...@apache.org> on 2019/05/28 07:22:00 UTC

[jira] [Comment Edited] (RATIS-563) Purge logs after snapshot only after all the nodes have catught up with the index

    [ https://issues.apache.org/jira/browse/RATIS-563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16849408#comment-16849408 ] 

Mukul Kumar Singh edited comment on RATIS-563 at 5/28/19 7:21 AM:
------------------------------------------------------------------

Thanks for updating the patch [~szetszwo]. The updated patch looks really good to me minor comment.

a) StateMachineUpdater.java:236, lets add an assert that purgeIndex <= lastAppliedIndex to make sure that non applied transaction will never be truncated.
b) RaftLog.java:340, Lets add a assert that index >= lastPurgeIndex, The caller i.e. stateMachineUpdater should never call with a lower index.
c) Another unrelated comment is that commitIndex should be set to last snapshot index if no metadata entry is found. This is important with purge as previous metadata entries might have been truncated.



was (Author: msingh):
Thanks for updating the patch [~szetszwo]. The updated patch looks really good to me minor comment.

a) StateMachineUpdater.java:236, lets add an assert that purgeIndex <= lastAppliedIndex to make sure that non applied transaction will never be truncated.
b) RaftLog.java:340, Lets add a assert that index >= lastPurgeIndex, The caller i.e. stateMachineUpdater should never call with a lower index.


> Purge logs after snapshot only after all the nodes have catught up with the index
> ---------------------------------------------------------------------------------
>
>                 Key: RATIS-563
>                 URL: https://issues.apache.org/jira/browse/RATIS-563
>             Project: Ratis
>          Issue Type: Bug
>          Components: snapshot
>    Affects Versions: 0.3.0
>            Reporter: Mukul Kumar Singh
>            Assignee: Tsz Wo Nicholas Sze
>            Priority: Major
>         Attachments: r563_20190522.patch, r563_20190524.patch, r563_20190528.patch
>
>
> Leader will purge the snapshot after applying a transaction. A transaction is applied after a majority has been reached. This means that a slow follower will request for a transaction which has already been purged and for this transaction to catchup the leader has to transfer the snapshot. This can be detrimental for the performance while replicating.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)