What a deploy carries, and when each change first went live

Two questions about production deploys used to share one table, deploy_pull, with a row for every merged pull each deploy carried: what does this deploy carry (the run page, the run API field carries, the terminal's deploys screen), and when did this pull first go live (ask-to-live on the map and the milestones). The forge's own repository has about 2,500 merged pulls and about 650 deploys a week, so each deploy wrote about 2,500 rows. On production that was 9.9M rows and 2.2 GB of a 4.6 GB file, and 98.5% of it was one repository (#12009, part of #11973).

What is kept now

The old table

Nothing writes deploy_pull any more. retention_deploys.ts trims what an older release wrote, in slices: it keeps the rows of deploys from the last retention.deploy_pull_days days (1 by default, DEPLOY_PULL_KEEP_DAYS; an admin moves it on /admin/limits) and of the deploy each app is running now, and deletes the rest. It starts only once deploy_landed has been filled from those rows (backfillLanded: for each pull merged in the last 7 days, the first deploy that carries it), so nothing ask-to-live reads goes with them. The table and its two indexes are dropped in a later release, once no release that writes it is left in play.

How it runs

src/system/retention.ts runs the trim and the backfill as paced jobs, retention-deploys (250 rows a slice, about 15 ms) and landed-backfill (60 pulls a slice). Each slice is its own short transaction; after a slice of t ms the job waits 19 t (never under 100 ms), so it takes 5% of the thread at most. It runs the same on the serving thread and on the engine's Worker. Both appear by name in the stall blame (perf/jobs.ts).

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs