Skip to content

Read only the end of the commits DB to find the last commit to mine from - #7647

Merged
marco-c merged 2 commits into
mozilla:masterfrom
marco-c:read-last-commit
Nov 24, 2026
Merged

marco-c merged 2 commits into
mozilla:masterfrom
marco-c:read-last-commit

Conversation

@marco-c

@marco-c marco-c commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

The commit retriever, the classify-patch hook, the landings risk report and the testing policy stats read the whole commits DB (12.6 GB) just to find the commit to start mining from, which takes about 70 seconds.

  • Read only the end of the DB: the new repository.get_last_commit reads only the last 256 commits, and reads all of them only when none of those passes the filters. On the current DB, it takes 0.03 seconds instead of 70.6 seconds, and returns the same commit.
  • Don't mine commits again: the scripts started from the last commit passing the default filters. When the DB ended with backouts, commits without a bug or ignored commits, they were mined and appended to the DB again, as download_commits saves all mined commits. They now start after the last commit of the DB, like the HTTP service does (http_service/bugbug_http/boot.py).

The commit retriever, the classify-patch hook, the landings risk report and the testing
policy stats read the whole commits DB (12.6 GB) to find its last commit, which takes
about 70 seconds. get_last_commit reads only the last 256 commits, and falls back to
reading all commits only when none of them passes the filters. On the current DB it
takes 0.03 seconds.
…iltered one

The scripts mining new commits started from the last commit passing the default
filters, so when the DB ended with commits that are filtered out (backouts, commits
without a bug, ignored commits), they were mined and appended to the DB again, as
download_commits saves all mined commits. Start after the last commit of the DB, like
the HTTP service does.
@marco-c
marco-c marked this pull request as ready for review November 24, 2026 13:00
@marco-c
marco-c requested a review from a team as a code owner November 24, 2026 13:00
@marco-c
marco-c merged commit 2774217 into mozilla:master Nov 24, 2026
12 of 13 checks passed
@marco-c
marco-c deleted the read-last-commit branch November 24, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant