BLOCKER: Daily note sync race duplicates successful device paragraphs #1279

Open
opened 2026-10-07 00:35:42 +00:00 by kayg · 0 comments
Owner

MERGE BLOCKER from adv31 / #1202

The real release server at product head 139d4378e duplicated two successful device paragraphs in the Journal sync race. All 40 Log creates that returned 201 survived exactly once, but sync paragraph 0 from a phone and sync paragraph 6 from a phone each appeared twice. Two other final PATCH requests returned 503 Index is busy; retry shortly.

The probe replaces a fresh Daily note with If-Match, retries a lost 412 race by reading the latest bytes and appending its unique paragraph, then checks final source bytes and Log identities. A late 412 after the filesystem write has committed can make that retry append the same paragraph twice. uploads::complete_install explicitly returns 412 if another Notes write changes the file between install and Index validation; Notes writers do not hold Files' namespace lock. This is the likely race, pending a deterministic regression.

Keep all existing assertions. Duplicate source text in a sync/write race blocks merge. The repair must coordinate the existing Notes writer and Files publication without a new lock-order deadlock; it must not turn genuine stale preconditions into success.

## MERGE BLOCKER from adv31 / #1202 The real release server at product head 139d4378e duplicated two successful device paragraphs in the Journal sync race. All 40 Log creates that returned 201 survived exactly once, but `sync paragraph 0 from a phone` and `sync paragraph 6 from a phone` each appeared twice. Two other final PATCH requests returned 503 `Index is busy; retry shortly`. The probe replaces a fresh Daily note with If-Match, retries a lost 412 race by reading the latest bytes and appending its unique paragraph, then checks final source bytes and Log identities. A late 412 after the filesystem write has committed can make that retry append the same paragraph twice. `uploads::complete_install` explicitly returns 412 if another Notes write changes the file between install and Index validation; Notes writers do not hold Files' namespace lock. This is the likely race, pending a deterministic regression. Keep all existing assertions. Duplicate source text in a sync/write race blocks merge. The repair must coordinate the existing Notes writer and Files publication without a new lock-order deadlock; it must not turn genuine stale preconditions into success.
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
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
kayg/calternal-v0#1279
No description provided.