Last modified: 2014-07-24 15:48:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70481, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68481 - Zuul repositories have too many refs causing slow updates
Zuul repositories have too many refs causing slow updates
Status: ASSIGNED
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
wmf-deployment
All All
: Normal enhancement (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks: 68480
  Show dependency treegraph
 
Reported: 2014-07-23 21:30 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-07-24 15:48 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2014-07-23 21:30:40 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.
Comment 1 Antoine "hashar" Musso (WMF) 2014-07-23 22:01:28 UTC
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']

=(
Comment 2 Antoine "hashar" Musso (WMF) 2014-07-23 22:04:49 UTC
That cause a bunch of issues. Will get a script to clean up obsolete references.
Comment 3 Antoine "hashar" Musso (WMF) 2014-07-24 12:54:46 UTC
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.
Comment 4 Antoine "hashar" Musso (WMF) 2014-07-24 14:01:23 UTC
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 .
Comment 5 Antoine "hashar" Musso (WMF) 2014-07-24 15:09:44 UTC
And that dropped roughly 21k references:

$ git show-ref |fgrep -c refs/zuul
29639
$

Will process operations/puppet as well.
Comment 6 Antoine "hashar" Musso (WMF) 2014-07-24 15:48:12 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links