Last modified: 2014-07-24 15:48:12 UTC
Zuul merge operations are quite slow. The reason is that fetches from Gerrit are painfully slow for some repositories: Under zuul@gallium:/srv/ssd/zuul/git/ : mediawiki/core$ time git fetch --dry-run real 0m18.353s user 0m17.781s sys 0m0.236s The operation is quite long because git send all references to the remote. And: $ git show-ref|fgrep -c refs/zuul 51185 $ We need a script that list all references matching refs/zuul/* , inspect the commit date and delete the reference it is older than X days (for example 30 days). That will help git fetch operation and thus speed up Zuul merge operations.
Example of an operation that took 1m20s: 2014-07-23 21:59:22,755 DEBUG zuul.Repo: Resetting repository /srv/ssd/zuul/git/mediawiki/core 2014-07-23 21:59:22,755 DEBUG zuul.Repo: Updating repository /srv/ssd/zuul/git/mediawiki/core 2014-07-23 22:00:04,755 DEBUG zuul.Repo: Checking out 6466a598a9579db0789055b73001e39a6d7840a5 2014-07-23 22:00:45,412 DEBUG zuul.Repo: Merging refs/changes/46/148846/2 with args ['-s', 'resolve', 'FETCH_HEAD'] =(
That cause a bunch of issues. Will get a script to clean up obsolete references.
I wrote a quick script which inspect the commit pointed by the Zuul reference and delete the reference whenever it is older than a given number of days (default 360). Proposed upstream as https://review.openstack.org/109276 Will run it on gallium.
zuul@gallium:/srv/ssd/zuul/git/mediawiki/core$ git show-ref|fgrep -c refs/zuul/ 51287 Then ran /home/hashar/zuul_clear_refs.py --until 360 .
And that dropped roughly 21k references: $ git show-ref |fgrep -c refs/zuul 29639 $ Will process operations/puppet as well.
I have cleaned up a few more repositories For reference, one can find the top 10 offenders by running: cd /srv/ssd/zuul/git find . -type d -name .git -exec bash -c 'echo -n "{}:"; git --git-dir {} show-ref|fgrep -c refs/zuul' \; | sort -nr -k2 -t: | head -n10 Lowering priority since the ref have been dealt with. Have to get Zuul fixed to garbage collect old references automatically.