The par2 prune gets 2 min per round (it held the merges back for hours); abandoned ranges past their end are finished
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c55918350e
commit
aa20d6b79f
6 files changed
+41
-4
No files matched your search
@@ -31,5 +31,12 @@ test.group('Leases', (group) => {
|
||||
// a1's worker went quiet: its lease is taken over (a2 alone counts).
|
||||
await db.from('ranges').where('id', a1).update({ heartbeat_at: new Date(Date.now() - 24 * 3600_000) })
|
||||
assert.equal(await leased(5), a1)
|
||||
|
||||
// Read to its end, its worker gone before finishing: done. One still reading, or quiet but not at its end, stays.
|
||||
await db.from('ranges').where('id', a2).update({ next_id: 201, heartbeat_at: new Date(Date.now() - 24 * 3600_000) })
|
||||
await db.from('ranges').where('id', b1).update({ next_id: 101 })
|
||||
assert.equal(await Leases.finishAbandoned(), 1)
|
||||
assert.equal((await db.from('ranges').where('id', a2).firstOrFail()).status, 'done')
|
||||
assert.equal((await db.from('ranges').where('id', b1).firstOrFail()).status, 'leased')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user