You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "yuuka (Jira)" <ji...@apache.org> on 2024/10/11 07:54:00 UTC

[jira] [Comment Edited] (RATIS-2154) The old leader may send appendEntries after term changed

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

yuuka edited comment on RATIS-2154 at 10/11/24 7:53 AM:
--------------------------------------------------------

[~szetszwo] 

Hi, Sze!

 
We may need to discuss this issue further
 
issue#2162's pr may cause the currentTerm! = expectTerm described in the current issue to occur again. After triggering Precondition.assert, it will cause logAppender to restart, although this has little impact.
 
In fact, we allow a brief termNum mismatch after a new Candidate or Leader appears, so we just need to use if condition to replace PreCondition.assert and print the relevant WARN log


was (Author: JIRAUSER306226):
[~szetszwo] 

Hi, Sze!

 
We may need to discuss this issue further
 
#2162‘ pr may cause the currentTerm! = expectTerm described in the current issue to occur again. After triggering Precondition.assert, it will cause logAppender to restart, although this has little impact.
 
In fact, we allow a brief termNum mismatch after a new Candidate or Leader appears, so we just need to use if condition to replace PreCondition.assert and print the relevant WARN log

> The old leader may send appendEntries after term changed
> --------------------------------------------------------
>
>                 Key: RATIS-2154
>                 URL: https://issues.apache.org/jira/browse/RATIS-2154
>             Project: Ratis
>          Issue Type: Wish
>          Components: Leader
>            Reporter: yuuka
>            Assignee: yuuka
>            Priority: Major
>             Fix For: 3.1.1
>
>         Attachments: image-2024-09-12-09-43-30-670.png
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The leader will become a follower after receiving a higher term, but during this process, the old leader may be appending LogEntry, and the error log will be printed until LogAppenderDaemon is closed.
> !image-2024-09-12-09-43-30-670.png!
>  
> I think we can put state.updateCurrentTerm (newTerm) later. Close LeaderState first before updating the term, and other operations remain unchanged.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)