The window worker keeps its window over a chunk that doesn't inflate
A live reply cut short (the server's compressed data ending at ".\r\n" at a read boundary; the spool keeps what Corpus.write refuses) made the worker give the group back without a snapshot, losing the window and the batch since its last post (six times in the first 40 minutes on homelab). Now the batch before the chunk goes out, the chunk is reported (fetched again, plain the second time) and the range is asked for again from that chunk (RangeOutcome::Again): the stream waits for the new copy and the window stays. Test: the coordinator hands the same range back at its resume point after a corrupt report. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f6e3316ec
commit
29e0cc8f6e
4 files changed
+34
-8
No files matched your search
@@ -6,7 +6,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import coordinatorConfig from '#config/coordinator'
|
||||
import GroupLeases from '#services/group_leases'
|
||||
import { LeaseLost } from '#services/leases'
|
||||
import Leases, { LeaseLost } from '#services/leases'
|
||||
import { Readable } from 'node:stream'
|
||||
|
||||
async function node(name: string) {
|
||||
@@ -71,6 +71,13 @@ test.group('Group leases', (g) => {
|
||||
assert.equal((await GroupLeases.next(b, n1))?.range.id, b1)
|
||||
await db.from('ranges').where('id', b1).update({ status: 'done', next_id: 101 })
|
||||
assert.equal((await GroupLeases.next(b, n1))?.range.id, b2)
|
||||
// A chunk of b2 that doesn't inflate, reported after the batch before it: the range is asked for again and
|
||||
// comes back at its resume point (the chunk fetched plain next time).
|
||||
await db.from('ranges').where('id', b2).update({ next_id: 151 })
|
||||
await Leases.corrupt(b2, n1, 151)
|
||||
assert.include(await rangeRow(b2), { status: 'planned', node_id: null })
|
||||
assert.deepEqual((await GroupLeases.next(b, n1))?.range, { id: b2, start: 101, end: 200, next: 151 })
|
||||
assert.deepEqual((await rangeRow(b2)).plain_chunks.map(Number), [151])
|
||||
await db.from('ranges').where('id', b2).update({ status: 'done', next_id: 201 })
|
||||
assert.isNull(await GroupLeases.next(b, n1), 'caught up')
|
||||
|
||||
|
||||
Reference in new issue
Block a user