An "ancient" range a group: articles 1 … low watermark − 1, never filled
Every group is tiled from article 1 now: one range with status 'ancient' covers what had expired on the server before the group was planned. Nothing selects it (leases, prefetcher, corpus fill, tail merger all take 'planned'), the status panel reports it apart, the search's history stats leave it out. Migration 6700 adds it for the groups planned before; Planner.historyRows (now a pure function, unit-tested) for new groups. The status bands are ordered by an explicit key: the ancient row at priority 0 tied "history 0-999" with "window 0". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
c18c320927
commit
68b480c97e
7 files changed
+119
-20
No files matched your search
@@ -94,6 +94,15 @@ test.group('Status', (group) => {
|
||||
])
|
||||
await writeFile(join(dir, `${g.id}.gz`), Buffer.alloc(2_000_000))
|
||||
await writeFile(join(dir, `${g.id}-tail.gz`), Buffer.alloc(1000))
|
||||
// A group planned from its low watermark 1000: its ancient range counts in no band and is never leased.
|
||||
const [old] = await db
|
||||
.table('groups')
|
||||
.insert({ name: 'alt.binaries.ancient', priority: 2 })
|
||||
.returning('id')
|
||||
await db.table('ranges').multiInsert([
|
||||
{ group_id: old.id, start_id: 1, end_id: 999, next_id: 1, priority: 0, status: 'ancient' },
|
||||
{ group_id: old.id, start_id: 1000, end_id: 1099, next_id: 1000, priority: 0 },
|
||||
])
|
||||
|
||||
const s = await StatusService.collect()
|
||||
assert.deepEqual(
|
||||
@@ -111,10 +120,11 @@ test.group('Status', (group) => {
|
||||
['raised', 1, 100, 0, 0, 0, 0],
|
||||
['window 0', 0, 0, 1, 1, 100, 0],
|
||||
['window 2', 1, 100, 0, 0, 0, 0],
|
||||
['history 0-999', 1, 100, 0, 0, 0, 0],
|
||||
['history 0-999', 2, 200, 0, 0, 0, 0],
|
||||
['history 4000+', 0, 0, 0, 0, 0, 1],
|
||||
]
|
||||
)
|
||||
assert.deepEqual(s.ancient, { groups: 1, articles: 999 })
|
||||
assert.deepEqual(s.lastHour, {
|
||||
indexedArticles: 100,
|
||||
doneRanges: 1,
|
||||
@@ -153,5 +163,6 @@ test.group('Status', (group) => {
|
||||
assert.include(text, 'window 0')
|
||||
assert.include(text, 'alt.binaries.status history status-node 301-400 351')
|
||||
assert.include(text, 'Snapshots: 2 files')
|
||||
assert.include(text, 'Ancient: 999 articles below the low watermark of 1 groups')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user