Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Enhance Meta-Service Cluster Management (#15601)
This commit introduces several optimizations and changes to the meta-service cluster management: - **Disallow Removing the Leader Directly:** - It is now disallowed to remove the leader from the cluster directly, because when leader is removed, the second step of removing a node can not be finished soon. To properly remove a leader, the leader node should be shut down first. After a new leader is established, use the command `databend-meta --leave-id <old-leader-node-id> --leave-via <new-leader-node-raft-address>` to remove the old leader from the cluster. Now removing a leader resulted in the error `"can not leave id=<i> via itself"`. - **Error Collection During Node Removal:** - Errors that occur during the process of removing a node are now collected and logged, enhancing error management and diagnostics. - **Adjustment of Time Configurations:** - **Heartbeat Interval:** Reduced from 1,000 milliseconds to 500 milliseconds, improving the responsiveness of the cluster to state changes. - **Election Timing for Followers:** Adjusted the duration a follower waits before starting an election process from a range of `[12,000 ms, 14,000 ms)` to a shorter range of `[2,500 ms, 3,000 ms)`, increasing the cluster's ability to quickly recover from leader failures.
- Loading branch information