You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2022/12/07 06:45:00 UTC

[jira] [Resolved] (RATIS-1751) Race condition between LeaderStateImpl & ServerState

     [ https://issues.apache.org/jira/browse/RATIS-1751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz-wo Sze resolved RATIS-1751.
-------------------------------
    Fix Version/s: 3.0.0
       Resolution: Fixed

The pull request is now merged.

> Race condition between LeaderStateImpl & ServerState
> ----------------------------------------------------
>
>                 Key: RATIS-1751
>                 URL: https://issues.apache.org/jira/browse/RATIS-1751
>             Project: Ratis
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 2.4.0
>            Reporter: Song Ziyang
>            Assignee: Tsz-wo Sze
>            Priority: Minor
>             Fix For: 3.0.0
>
>         Attachments: error_stack.log
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> An IndexOutOfBoundsException is thrown from LeaderStateImpl during runtime. The error stack is attached.
> After checking the code, I think there are data race conditions between LeaderStateImpl.voterLists and ServerState.ConfigurationManager.currentConf.
> CurrentConf and voterLists should be updated synchronously, since there're strongly-related. However, in 2.4.0, currentConf in ServerState is updated in server-thread-pool, while voterLists in LeaderStateImpl is updated in LeaderState EventProcessor thread. There is possibility that IndexOutOfBoundsException occurs due to this data race.
>  



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