huskies: merge 664_story_crdt_lamport_clock_inner_seq_must_resume_from_max_own_author_seq_1_instead_of_resetting_to_1_on_restart_phase_c

This commit is contained in:
dave
2026-04-27 12:26:28 +00:00
parent 25603bb8cb
commit 9040d18f50
5 changed files with 240 additions and 2 deletions
+13
View File
@@ -134,6 +134,19 @@ pub fn write_node_presence(node_id: &str, address: &str, last_seen: f64, alive:
// Rebuild node index after insertion.
state.node_index = rebuild_node_index(&state.crdt);
// Advance the inner registers of the newly-created node to the Lamport
// floor so their first local ops don't re-emit low sequence numbers.
let floor = state.lamport_floor;
if floor > 0
&& let Some(&idx) = state.node_index.get(node_id)
{
let node = &mut state.crdt.doc.nodes[idx];
node.node_id.advance_seq(floor);
node.address.advance_seq(floor);
node.last_seen.advance_seq(floor);
node.alive.advance_seq(floor);
}
}
}