fix: dn doesn't have chance to send a heartbeat to the new leader (#2471)

* refactor: set meta leader lease secs to 3s

* fix: correct default heartbeat interval

* refactor: ask meta leader in parallel

* feat: configure heartbeat client timeout to 500ms

* fix: trigger to send heartbeat immediately after fail

* fix: fix clippy
This commit is contained in:
Weny Xu
2023-09-26 14:05:38 +09:00
committed by GitHub
parent 54e506a494
commit 230a3026ad
10 changed files with 77 additions and 29 deletions

View File

@@ -29,3 +29,9 @@ pub const REGION_LEASE_SECS: u64 =
/// When creating table or region failover, a target node needs to be selected.
/// If the node's lease has expired, the `Selector` will not select it.
pub const DATANODE_LEASE_SECS: u64 = REGION_LEASE_SECS;
/// The lease seconds of metasrv leader.
pub const META_LEASE_SECS: u64 = 3;
// In a lease, there are two opportunities for renewal.
pub const META_KEEP_ALIVE_INTERVAL_SECS: u64 = META_LEASE_SECS / 2;