design: gossip cannot express a deletion, or restore a node's own history #52
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The dedupe pass on the laptop (see #43) exposed a structural gap rather than a bug in the sync code.
What happened
7,172 duplicate observations were removed locally. Gossip is append-only and per-node:
GET /v1/log?node=Xserves only rows owned by X (WHERE node_id=X).Pushsends onlynode_id = self.INSERT OR IGNOREs on(node_id, hcl).Result: the laptop is at 8,936 rows, dhg.lol still holds 15,289 rows owned by the laptop. No sync will ever remove them, and none of them can come back either.
The two problems
1. A rewrite is invisible. Any deliberate deletion, compaction or rebuild diverges from every replica, permanently, and silently. Today the only way to keep replicas consistent is to run the same destructive pass on each one by hand. As knox grows more derived state, that stops being reasonable.
2. The replica cannot restore the origin. If this laptop's DB were lost, its own 15,289 rows on dhg.lol are unreachable: pull is scoped to the peer's node id, and the spoof guard rejects rows under ours. Restoring an older local backup is also only half-healed — peers re-send their own rows, never ours.
That means "the always-on node is my backup" is currently false, and nothing in the docs says so.
Options (not decided)
(node_id, hcl, fingerprint)and adeletedmarker; reconcile applies per-fingerprint LWW. Costs a second meaning for "observation" and unbounded growth unless compacted.Constraints
Acceptance
Context
Numbers and the cleanup itself are in #43. The 158 rows under
f371930f(an older identity for this laptop) show the same problem from the other side: an abandoned node id whose data nothing can address.