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

Method run

nodedb-cluster/src/decommission/coordinator.rs:71–91  ·  view source on GitHub ↗

Propose every entry in the plan sequentially, waiting for each commit. Returns the total number of entries committed and the final applied index.

(self)

Source from the content-addressed store, hash-verified

69 /// each commit. Returns the total number of entries committed
70 /// and the final applied index.
71 pub async fn run(self) -> Result<DecommissionRunResult> {
72 let node_id = self.plan.node_id;
73 let total = self.plan.entries.len();
74 info!(node_id, steps = total, "decommission coordinator starting");
75 let mut last_applied = 0u64;
76 for (step, entry) in self.plan.entries.into_iter().enumerate() {
77 debug!(node_id, step, total, "proposing decommission entry");
78 last_applied = self.proposer.propose_and_wait(entry).await?;
79 }
80 info!(
81 node_id,
82 entries_committed = total,
83 last_applied,
84 "decommission coordinator finished"
85 );
86 Ok(DecommissionRunResult {
87 node_id,
88 entries_committed: total,
89 last_applied_index: last_applied,
90 })
91 }
92}
93
94#[cfg(test)]

Calls 2

lenMethod · 0.45
propose_and_waitMethod · 0.45

Tested by

no test coverage detected