Repository navigation
Speed up the HTTP service worker boot - #7646
Merged
Merged
Conversation
robustcheckout pulls twice (into the pooled store, then into the share), and mozext records the pushes in the changetracker.db of each repository rather than in the shared store, so the whole pushlog (about 290k pushes for autoland) was downloaded and processed twice, with the copy of the pooled store never used. Disable the mozext database for the clone, and retrieve the pushes once by pulling in the share.
The worker read the whole commits DB (12.6 GB) to find its last 4096 commits, which took 81 seconds of the boot. Read them from the end of the file instead, which takes about a second. The commits are no longer filtered like get_commits does: the commits after the last one in the DB are the ones to mine, and starting from an older one mined again (and appended to the DB a second time) the last commits when they were filtered out, e.g. backouts or commits without a bug, as the last one of the DB currently is.
marco-c
force-pushed
the
faster-worker-boot
branch
from
November 24, 2026 10:13
8c726d0 to
806e12a
Compare
…gether DB update_touched_together read the whole commits DB (12.6 GB) to find the last commit it analyzed, which took 68 seconds of the worker boot to add a few hundred commits. When it's among the last 10000 commits of the DB, only those are read now, starting 2000 commits before it, so that the revisions sent which are slightly before it (as commits can be in a different order in mozilla-central and autoland) are still found as already analyzed. Otherwise (e.g. when generating the DB from scratch), the whole DB still is. This also speeds up the daily runs of the test scheduling history retriever, which resume from the last analyzed commit.
The patches were mined in chunks of 64 commits, so the 393 commits mined when the worker booted were split in 7 chunks, leaving 9 of the 16 processes idle, and the step took 50 seconds. Give several chunks to each process, and keep chunks of 64 when mining many commits.
marco-c
force-pushed
the
faster-worker-boot
branch
from
November 24, 2026 10:30
806e12a to
64bbcb0
Compare
marco-c
marked this pull request as ready for review
November 24, 2026 10:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The prod worker took 9m40s to boot. Most of it was on a single critical path: about 4.5 minutes waiting for the autoland clone, then three steps that each read the whole commits DB or barely used the available processes. Each commit fixes one of these:
changetracker.dbper repository rather than in the shared store, so the whole autoland pushlog (about 290k pushes) was downloaded and processed twice, and the pooled store's copy was never used. The clone now runs withmozext.disable_local_database=true, followed by one pull in the share. Estimated saving: about 60-90s, based on the log's progress bars.db.read_lastand uses it instead of reading the 12.6 GB DB to get its last 4096 commits. This took 81s and now takes about a second. The nodes are no longer filtered likeget_commitsdoes. With the filtering, when the newest commits of the DB were filtered out (backouts, commits without a bug, etc.), they were mined and added to the DB again. The current DB ends with such a commit.update_touched_togetheris among the last 10000 commits of the DB, only those are read, starting 2000 commits before it. The margin means revisions sent slightly before it (commits can be ordered differently on mozilla-central and autoland) are still recognized as already analyzed. Otherwise the whole DB is read, as before (e.g. when generating it from scratch). The commit is found by searching the raw lines, so only the commits actually used are deserialized. This took 68s at boot. With the current DBs it takes 2.5s, and the daily resumed runs of the test scheduling history retriever get faster too.Together these should bring the boot to about 5 minutes.
The pushlog change is covered by a new test, which checks that after a clone
changetracker.dbis in the share and not in the pooled store. It fails without the flag and without the follow-up pull. It was also checked against autoland without a full clone: a pull that brings no changesets (hg pull -r nullinto an empty repo) still fetches the whole pushlog (289,341 pushes, 85 seconds locally, roughly what this saves per boot). The push IDs and dates it records match json-pushes, and a second pull fetches only the new pushes.