MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / set_leader

Method set_leader

nodedb-cluster/src/routing.rs:147–151  ·  view source on GitHub ↗

Update the leader for a Raft group.

(&mut self, group_id: u64, leader: u64)

Source from the content-addressed store, hash-verified

145
146 /// Update the leader for a Raft group.
147 pub fn set_leader(&mut self, group_id: u64, leader: u64) {
148 if let Some(info) = self.group_members.get_mut(&group_id) {
149 info.leader = leader;
150 }
151 }
152
153 /// Atomically reassign a vShard to a different Raft group.
154 /// Used during Phase 3 (atomic cut-over) of shard migration.

Callers 15

simulate_cutoverFunction · 0.80
set_leaderFunction · 0.80
on_state_changeMethod · 0.80
rt_with_leadersFunction · 0.80
apply_routing_changeMethod · 0.80
apply_compensationFunction · 0.80
routing_hot_onFunction · 0.80

Calls 1

get_mutMethod · 0.45