Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
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.
szetszwo What's your opinion?
Attachments
Attachments
Issue Links
- links to