Skip to content

gitserver: Reduce the number of repos we iterate over

Administrator requested to merge core/reduce-queried-repos into main

Created by: ryanslade

The main purpose of the change is to stop gitsever from iterating over ALL repos in the database every 10 minutes.

Once we've iterated over all repos at least once without error we can be sure that they have all been assigned a shard_id. On subsequent iterations we only need to sync repos that don't yet have a shard_id. Each instance currently takes care of updating clone status on demand.

As a special case, we need to ensure that we always perform a full sync again if the gitserver addresses change as this leads to a full rebalance with our current sharding method as it used md5 hashes.

Merge request reports

Loading