Cluster sync: an exact timestamp tie can settle differently on two nodes, and a second collision from the same creating node repeats a renamed name #465

Open
opened 2026-11-14 11:15:35 -05:00 by claude · 0 comments
Owner

Found while #450 was verified. Both are narrow; neither blocked #450.

  1. Exact-tie rule. ClusterSyncConflictResolver.IncomingWins treats a local row with no recorded origin as Guid.Empty, while the sender stamps the same kind of row with its real node id. With identical last-change times, node X can treat peer Y's row as the winner while Y treats X's row as the winner, so the two disagree on who keeps a name such as admin. The same mismatch lets a node accept an echo of its own row on a tie (harmless: same row id). Bootstrap rows are created at different ticks, so this is unlikely, but README and the wiki say a tie "settles the same way on every node". Wanted: use the holding node's id for a row with no recorded origin in the comparison too (as the rename now does), with a test for an exact tie on both sides.
  2. Same creator, second collision. A renamed row is named <name>-conflict-<creator id>. If node A's first loser already holds admin-conflict-<A> and node A later creates another admin that loses again, the new name is the same and the save hits the unique index. The same happens for two names longer than 212 characters, created on one node, that differ only after the cut point. Failure mode today: the exception is caught in ClusterChannelController.ConfigSync, logged as an error, and that one envelope is not applied; the stream carries on. Wanted: a deterministic way to tell such rows apart that every node computes alike (for example a short hash of the row id in the suffix when the plain name is taken), or a documented decision that the row is skipped, with a log line that says how to resolve it.
  3. Wording: "the node that created it" is the row's recorded origin, which a later edit on another node does not change. Fine as behaviour; say "recorded origin" where the docs need to be exact.
Found while #450 was verified. Both are narrow; neither blocked #450. 1. **Exact-tie rule.** `ClusterSyncConflictResolver.IncomingWins` treats a local row with no recorded origin as `Guid.Empty`, while the sender stamps the same kind of row with its real node id. With identical last-change times, node X can treat peer Y's row as the winner while Y treats X's row as the winner, so the two disagree on who keeps a name such as `admin`. The same mismatch lets a node accept an echo of its own row on a tie (harmless: same row id). Bootstrap rows are created at different ticks, so this is unlikely, but README and the wiki say a tie "settles the same way on every node". Wanted: use the holding node's id for a row with no recorded origin in the comparison too (as the rename now does), with a test for an exact tie on both sides. 2. **Same creator, second collision.** A renamed row is named `<name>-conflict-<creator id>`. If node A's first loser already holds `admin-conflict-<A>` and node A later creates another `admin` that loses again, the new name is the same and the save hits the unique index. The same happens for two names longer than 212 characters, created on one node, that differ only after the cut point. Failure mode today: the exception is caught in `ClusterChannelController.ConfigSync`, logged as an error, and that one envelope is not applied; the stream carries on. Wanted: a deterministic way to tell such rows apart that every node computes alike (for example a short hash of the row id in the suffix when the plain name is taken), or a documented decision that the row is skipped, with a log line that says how to resolve it. 3. Wording: "the node that created it" is the row's recorded origin, which a later edit on another node does not change. Fine as behaviour; say "recorded origin" where the docs need to be exact.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#465
No description provided.