You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4994e1a
Browse filesBrowse the repository at this point in the historyBrowse files
hzq
committed
Scan retention candidates in bounded rowid windows
Advance past retained prefixes without dropping the per-page eligibility checks. Keep file reference snapshots valid across their own receipt writes while still rechecking external changes.
Copy file name to clipboardExpand all lines: docs/stability.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -555,9 +555,12 @@ settlement readback; delegated descendants of a kept ancestor; files still liste
555
555
kept run. When a producer is pruned, a retained artifact keeps its original agent read requirement, owner and subject. Continuing a run that was pruned returns 404, like any
556
556
unknown response ID.
557
557
558
-
How it runs: candidate runs are deleted in batches of 200 inside short `BEGIN IMMEDIATE`
559
-
transactions, yielding to the event loop between batches, so requests keep being served. Each
560
-
batch checks current readbacks, including internal runs without an API-key accounting record. Blobs
558
+
How it runs: run selection advances in rowid windows of 200, including empty windows, up to
559
+
the high-water mark at the start of the sweep. It does not scan retained prefixes again.
560
+
Live deletion checks current age, scope, ancestry and readbacks inside each
561
+
`BEGIN IMMEDIATE` transaction and yields between windows. A run that becomes eligible
562
+
after its window was visited is picked up on a later sweep. Dry runs use the same windows
563
+
without taking the writer lock. Blobs
561
564
are removed after their rows commit; a crash in between leaves orphaned blobs, which the next
562
565
prune removes. On a live gateway a contended write lock is retried between event-loop turns within the existing SQLite timeout. After deletion the gateway uses a passive WAL checkpoint rather than waiting for long-lived readers; the WAL may stay allocated for reuse. An offline prune still uses a truncating checkpoint. Without `--vacuum`, SQLite reuses the freed pages, so the file stops
563
566
growing at the size of the retained window instead of shrinking.
@@ -566,6 +569,11 @@ A nonempty deletion batch writes a receipt in the same transaction. If the commi
566
569
is lost, only the matching stored receipt lets the gateway publish the change, count the batch
567
570
or unlink its blobs. Otherwise it reports `409 effect_outcome_unknown` and stops the sweep;
568
571
earlier confirmed batches are not undone. It never reruns the uncertain delete.
572
+
File pruning ignores its own receipt writes when tracking cached references, but still rechecks
573
+
references when another writer has changed the database.
574
+
575
+
`node dist/bench/prune-candidates.js` measures candidate-query time on a temporary database
576
+
with a large retained prefix ahead of expired rows. It does not invoke a model.
0 commit comments