Partial writes without compensation in merge, fork, transfer and quota #108

closed cmc opened this on 2026-09-03 05:14 UTC · bug control · milestone v1.10.0

Discussion

cmc 2026-09-03 05:14 UTC
  • runMRMerge: UpdateRefCAS (mr.go:1099) then MarkMerged (:1102). If the second fails the branch has moved and the MR stays open; a retry refuses at :897 because the target already contains the head.
  • runRepoFork: CreateRepo then SetForkOf (mr.go:103-109); a failure leaves a repo row without a directory.
  • runRepoTransfer: the revert at repo.go:388, :393 ignores its own error.
  • checkRepoQuota (repo.go:191) then CreateRepo is check-then-act with no lock.

Remedy: make MarkMerged idempotent when the head is already an ancestor of the target; put SetForkOf inside CreateRepo's transaction.

closed by commit 84e1f08f23 by cmc: control: no write sequence leaves a half state

2026-09-04 01:17 UTC

referenced in commit 5e9732fb1d by cmc: store: one admin's settings change no longer overwrites another's

2026-09-04 15:58 UTC