Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-1874

Add notifyLeaderReady function in IStateMachine

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • StateMachine
    • None

    Description

      In a highly available metadata service built on top of Ratis, such as IoTDB's confignode, the Leader node launches more modules compared to the Follower node. These additional modules include functionalities like load balancing and others.

      Currently, we employ the "notifyLeaderChange" callback to prompt the Leader to initiate the corresponding modules like load balancing. However, within this callback, the leader's state machine might not have fully recovered, potentially leading to the retrieval of outdated data when directly reading from certain modules.

      One approach in this scenario would involve utilizing a linearizable read interface along with implementing corresponding retry logic (such as timeouts or waiting until a leader is elected). However, such modifications would result in significant changes to our codebase. Therefore, we are inclined to opt for an alternative solution – adding a "notifyLeaderReady" interface to the "StateMachine". This interface would be invoked only when the Leader's state machine applies the first log entry of its current term. This adjustment would ensure the accurate recovery of certain modules.

       

      Tsz-wo Sze What's your opinion?

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tanxinyu Xinyu Tan
            tanxinyu Xinyu Tan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 40m
                2h 40m

                Slack

                  Issue deployment