···11+# getRepo notes
22+33+Context: on 2026-06-29, operators called out `com.atproto.sync.getRepo` as an expensive route for PDS hosts. The main concerns were compression cost, large repo export reads, avoiding disclosure of stale/deleted blocks, and isolating backup/backfill traffic from user-facing work.
44+55+ZDS is directly relevant because it serves `com.atproto.sync.getRepo` from `src/atproto/sync.zig`.
66+77+Current shape:
88+99+- ZDS serves raw CAR bytes and does not appear to add application-layer gzip, so it avoids the Node compression issue described in the operator thread.
1010+- Full repo export is built from SQLite `repo_blocks`, ordered by CID.
1111+- Incremental export with `since` filters by `repo_rev`.
1212+- Repo writes already use lazy MST loading backed by `repo_blocks`, so ZDS is closer to a Hubble-style block/CAR-serving shape than an eager full-repo rebuild path.
1313+- `subscribeRepos` has a connection cap, but `getRepo` does not appear to have route-specific backpressure.
1414+1515+Open questions:
1616+1717+- Should full `getRepo` walk the current commit/MST and include only reachable blocks, instead of exporting every retained block for the DID?
1818+- Do retained old MST or record blocks make the current full export disclose deleted or stale record data?
1919+- Should `getRepo` have route-specific concurrency or rate limits separate from normal public reads?
2020+- Should the benchmark suite compare the current range-scan export against a reachability-based export for small, medium, and large repos?
2121+2222+Suggested next pass:
2323+2424+1. Add a regression test for delete/update followed by full `getRepo`, checking whether stale record blocks are exported.
2525+2. If stale blocks are visible, change full export to current-root reachability rather than whole-DID block scan.
2626+3. Add lightweight route backpressure for full `getRepo`.
2727+4. Re-run `bench repo-size` and keep raw range-scan numbers separate from reachable-export numbers.