Repository navigation
Faster backfill and smaller storage: split backfill, packed message-ids, sealed blobs, auto compact - #1
Conversation
…, auto compact Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A server is article only after 3 GROUP refusals in a row, not one (news.frugalusenet.com was switched off by one odd group name). - Groups their first server doesnt carry fall back by connection weighted rendezvous hashing instead of the first server in the list, and remember where they live. - request_size 10000 / batch_size 500000 by default: measured 3-6x the headers/s per connection on old articles (examples/probe_xover.rs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Replace select-then-update in claim with atomic UPDATE...RETURNING - Wrap insert loop in add with unchecked_transaction - Add doc comments to create, is_split, finish, release - Add concurrent-connection test verifying atomicity Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Replace split_groups() + per-group progress() calls with one SELECT that aggregates all backfill_chunks data in a single scan. Store stats as tuple (groups, splitting, done, total, done_last_hour) to avoid per-group allocations. Draw shows: "split groups: N (M in progress), day chunks D of T done, L in the last hour". Add test verifying aggregate query on in-memory db. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Blobs are rewritten too: domain uses are counted inside blobs, segments of dropped domains become whole ids and kept ones are repacked. Files are copied in id order next to their rows and due ones sealed on the way, so the copy has no free pages. A corrupt blob stops the shard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compaction now tries every shard: a failed one keeps its original and the rest are swapped and their backups removed, then run reports each failure. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
compact::run takes a stop flag (checked per file, per phase, before the swap, and inside long SQL statements) and leaves the originals alone when stopped. The indexer's db writers are joined before compacting, a missing shard after compaction stops the indexer, and the 24 hour clock counts from the first start. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ompact Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A probe that landed on 100+ missing numbers sent the binary search left, pulling chunk starts far back and cutting chunk ends short, soo a day's articles past the gap were never fetched. Probes now scan forward in doubling windows (spreading out past 6,400 numbers) and only go left when nothing exists after the probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…minute Every save tick used to scan 8,000 files rows and, on first start, seal every pre-upgrade file online. Now a writer seals the files its own saves completed (up to 50,000 remembered), walks the files table at most every SEAL_WALK_EVERY seconds, skips the tick while more saves are queued, and leaves files never touched since the upgrade to --compact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Writers are joined on shutdown, soo every queued save plus a seal tick per batch ran before the indexer could exit. A writer now skips sealing once its queue is closed, and drops queued slices whose pass is gone (their cursor didnt move, the headers get fetched again). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A group taken out of config.json, or indexed live only, kept its pending day chunks and idle workers still claimed and fetched them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI search saves and the broken release purge wrote into the original shard after the compaction took its copy, and were lost at the swap. Compaction now holds an atlas.compacting lock file (pid and start time, removed on every exit, ignored once that process is gone) and those writes refuse while it's there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l it looks at Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…w the reach moved past is ignored Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review Round 26 fixes are in 4021482. 🤖 Addressed by Claude Code |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4021482c9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ts longer on a slow runner Each chunk of the speculative window cost more the more articles the deep server held, and ubuntu's 2-core runner ran out of its 180 s while still making progress (58 of 90 chunks). The window and the sweep it proves are the same with 2190 forged days. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ot in memory A shard can have as many domains as a poster makes up, and four shards are compacted at once: a map of them all could run out of memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plain group cursor stays only for a lone unkeyed server: one left over from a server since removed would have the keyed one skip ranges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ir articles, none held A loose file can have any number of articles, and both the original's and the copy's were held at once. Each is now a count and a sum of row hashes, whatever their order; a copy that lost second copies of a message-id is worked out in a database file of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Lines 199 to 202 in bb7199a
When three or more servers have skewed connection counts, applying .max(1) after proportional division can make given exceed total, and the code only corrects undersubscription. For example, parallel_groups = 3 with connection counts [100, 1, 1] produces [2, 1, 1], so run_servers spawns four workers despite the configured cap, increasing concurrent parsing and memory use. Reserve one worker per server before distributing the remainder, or explicitly remove any over-allocation.
Lines 647 to 648 in bb7199a
When a legacy database contains a release with an unbounded number of articles, this validation collects every old article into one Vec; it then collects the converted side again with store::articles and renders both complete NZBs in memory. The newest 200 releases are always checked, so a large attacker-posted release can make --convert or startup conversion exhaust memory after the full copy has completed, and every retry reaches the same failure. Compare the ordered rows or rendered output with a streaming digest instead.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…s it Its database file attached the shard and stayed open till the end of the compaction, and Windows wont rename an open file: it is detached once counted, and the count is dropped before the check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
…and the release check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
💡 Codex ReviewLines 1423 to 1426 in 561c277 When a release temporarily receives a second filename whose articles are all duplicates, ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…e it was alone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne file is left Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… conversion's swap is taken out of the way Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review Round 28 fixes are in f7a771f, including the review-comment finding: the release index and marker are cleared when a duplicate-only file is deleted (929c37f). Also 561c277 fixes the Windows CI failure (scratch db left the original shard attached during the swap). 🤖 Addressed by Claude Code |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
* spots: check spot signatures as Spotweb does A spot's From header carries RSA signatures (PKCS #1 v1.5, SHA-1): the header signed by Spotnet's keys 2-4, or a self-signed key-7 spot with a hashcash, and the message-id signed by the spotter's own key. Spots are now kept only when these hold, checked on the overview and again on the HEAD (for spots noted before), and the spotter id stored is the one the spotter's signature proves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * spots: review fixes for signature checks Build the signed text as bytes, so a multibyte character before the '<' can't panic the spot task; reject an empty nickname and a user key that won't decode, as Spotweb does; take only signatures exactly as long as the key; note which verdicts rest on decoded text; and say whether the spotter's key signed the message-id itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Speeds up backfill and shrinks the database:
request_size10000,batch_size500000).split_min_backlog(10M), the group's history is cut into UTC day chunks. Idle workers on any server that carries the group claim the chunks.backfill_chunkstable inatlas.db. Claims are atomic, and a stale claim is taken over after 30 minutes.--compactseals every file that's due while it copies, and re-encodes message-ids.auto_run_compact(defaultfalse): compacts every 24 hours inside the indexer.Spec:
docs/superpowers/specs/2026-10-05-faster-backfill-smaller-storage-design.mdPlan:
docs/superpowers/plans/2026-10-05-faster-backfill-smaller-storage.mdUpgrading an existing database
files.touched_at,files.blob). Adding them is instant and doesn't rewrite any table.atlas --compactonce, with the indexer stopped, to re-encode and seal them. Expect roughly 138 GB to drop to about 60 GB.Known limits
Test plan
just format,just lintandjust testare clean (131+ tests).atlas --compacton the real database, then compare NZBs and stats.🤖 Generated with Claude Code