carlos / platform Public

Offline moves: Litestream compaction writes during the final mirror round open

Offline moves: Litestream compaction can write to the source during the final mirror round.

Found while chasing an intermittent TestOfflineLandHappyPath failure in full internal/host runs on branch region-ha-g3-fixes. The failure reads "final mirror round: 1 object(s) changed at the source during the copy".

What the trace shows. The test uses real lease.ReplicateWithLease, newMovesWorker / offlineRound, and the loopback S3 server. The sealer's checkpoint writes a level-9 snapshot and deletes its lease. After that, Litestream's background compaction is still running, and it PUTs a new level-1 LTX object (instances/<host>/0001/...ltx) while the mirror is copying. The mirror's final source listing then differs from what it staged, so the seal is refused.

Effect. The move fails safe: it refuses, and nothing is corrupted. But a real box could hit the same timing, and the move would then need a retry. The test fails intermittently for the same reason.

Likely fix. Stop (or join) the replica's compaction before the sealing checkpoint returns. The alternative is to have the mirror ignore compaction-level objects written after the seal. Only do that if they are provably redundant with the level-9 snapshot.

The full request trace is in the branch's SDD task-10 report; ask the G3-fix controller for it. Not fixed on region-ha-g3-fixes, which is out of scope there.

Seen again in CI on branch design-first-run-next-steps @ 4b585e39 (2026-11-08 ~13:33Z), internalhost@3: TestOfflineLandMendsWhatIsMissing/replicationchanged, 'final mirror round: 1 object(s) changed at the source during the copy'. Passes 10/10 locally. The branch doesn't touch internal/host.