Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 77a8b7471ea65971987aee6f476e2f015bf62d3242a02871389b422f8561eee2
Ticket: fbe8dbfcc230b567da3d6a8da157cc68961d3761
Fleet surfaces are O(repos) and will not survive thousands of stores
User & Date: dmestas on 2026-08-18 19:56:50
Changes

  1. Untracked field cmimetype: "text/x-markdown"
  2. comment changed to:
    Everything fleet-wide today walks every repository. At 23 stores that is invisible; it is linear, so it is a wall rather than a slope.
    
    Measured now, and the naive extrapolation to 10,000 stores:
    
    | surface | 23 repos | ~10,000 |
    |---|---|---|
    | `repo.list` | 42 ms | ~4 s |
    | `people.list` | 8 ms | ~6.5 s |
    | `search.all` | 415 ms | ~40 s |
    
    `search.all` is the worst because each repository is a separate SQLite file and a separate FTS query. It is also the one with a hard resource floor: 10,000 open database handles.
    
    ## What has to change
    
    1. **Paging, everywhere.** `repo.list` returns every repository and the landing page renders all of them. It needs a cursor and a page size, and the fleet SSE stream has to page with it or a repaint re-sends the whole listing.
    2. **Never open every index to answer a fleet question.** `people.list` and the tab counts should read a fleet-level rollup in the forge OLTP, refreshed on ingest, rather than fanning out per request. The per-repo `contributor` table is already the right shape to roll up from.
    3. **Search needs a different mechanism, not a bigger fan-out.** Fan-out was the honest choice at this size and it stays correct, but past roughly 500–1,000 stores it has to become one shared index. That is the point at which the contentless-FTS work becomes worth doing too, since the shared index is where the duplicated `search_doc` text would otherwise be paid for again.
    4. **Bound the handles.** An index handle per served repository is a file descriptor per repository held open forever. That needs an LRU of open indexes with the rest closed.
    
    ## Order
    
    Paging first — it is the only one a reader notices immediately, and it is contained. The rollup second. The shared search index last, because it is the one that changes the architecture rather than the queries, and it should be done with a real corpus to measure against rather than speculatively.
    
  3. severity changed to: "Important"
  4. status changed to: "Open"
  5. title changed to:
    Fleet surfaces are O(repos) and will not survive thousands of stores
    
  6. type changed to: "Code_Defect"