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

Song Ziyang commented on RATIS-2138:
------------------------------------

It seems like the Precondition helps catch a race condition. Shall we rearrange 
the order of updateMetadata and shutdownLeaderState to avoid that race?

> Remove uncessary error log in JVMPauseMonitor When GC is serious
> ----------------------------------------------------------------
>
>                 Key: RATIS-2138
>                 URL: https://issues.apache.org/jira/browse/RATIS-2138
>             Project: Ratis
>          Issue Type: Improvement
>          Components: util
>            Reporter: Xinyu Tan
>            Assignee: Xinyu Tan
>            Priority: Major
>         Attachments: image-2024-08-12-14-13-05-825.png, 
> image-2024-08-12-14-14-45-615.png, image-2024-08-12-14-17-13-030.png
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> JVMPauseMonitor may be printing unexpected Error logs when GC is heavy and 
> the cluster keeps triggering re-election. 
> !image-2024-08-12-14-13-05-825.png! 
> After investigating the relevant code, it is found that the Preconditions 
> here are unreasonable. When we update, we will first update the serverstate's 
> term and then shutdown LeaderState. If any other thread calls leaderState's 
> getCurrentTerm in the meantime, this will cause an error, so it's not 
> necessary at this point
>  !image-2024-08-12-14-14-45-615.png! 
>  !image-2024-08-12-14-17-13-030.png! 



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

Reply via email to