fix(supervisor): re-review changed sources instead of failing the run

This commit is contained in:
mesalogo
2026-10-09 17:05:26 +08:00
parent 46a40e7fbf
commit dc582b7acf
9 changed files with 172 additions and 81 deletions
@@ -70,9 +70,10 @@ it('scans read-only, transfers at most 200 rows, yields without a transaction, a
expect(wrote).toBe(true)
expect(f.store.progress(f.runId).sources).toBe(450)
expect(f.store.load(f.runId).initializing).toBeUndefined()
// Frozen scan revisions must not silently advance to the concurrent write.
await expect(f.store.resumeWithReader(f.runId, f.reader)).rejects.toThrow('source changed')
expect(f.store.load(f.runId).restartRequired).toBe(true)
// A concurrent write is detected on resume and that one source is re-frozen, not the whole run failed.
await f.store.resumeWithReader(f.runId, f.reader)
expect(f.store.progress(f.runId)).toMatchObject({ sources: 450, revisedSources: 1 })
expect(f.store.load(f.runId).restartRequired).toBeUndefined()
await expect(f.worker.call('reviewManifestPage', [f.runId, 0])).rejects.toThrow('lost its snapshot')
})