system-config/playbooks/roles/gerrit/templates/replication.config.j2
Thierry Carrez 6935318712 No longer push refs/changes to GitHub mirrors
By default gerrit replication pushes +refs/*:refs/*, which includes
refs/changes. For large repositories that potentially means hundreds
of thousands of references.

Per-repo git mirroring does not push refs/changes, so when it runs it
ends up deleting those references, which can take a long time, blocking
the executor.

To fix that, we should:
- stop pushing refs/changes to GitHub (this change)
- delete refs/changes on GitHub repositories, asynchronously
- enable per-repo replication
- disable Gerrit-wide replication

NB: it is unclear if Gerrit replication would start deleting the
    extraneous references on remote GitHub repositories once this
    merges. If this is the case, since replication is limited to a
    single thread (default value for 'threads') and is not happening
    in an executor, this should not have negative impact, beyond
    potentially delaying GitHub mirroring.

Change-Id: I94f69c889c9b4418ef81b3b2ca436ba99696ba72
2020-04-17 11:54:01 +02:00

38 lines
1021 B
Django/Jinja

# This file is managed by ansible.
# https://opendev.org/opendev/system-config
[gerrit]
defaultForceUpdate = true
autoReload = false
replicateOnStartup = false
{% for replication in gerrit_replication %}
[remote "{{ replication.name }}"]
url = {{ replication.url }}${name}.git
{% if 'replicationDelay' in replication %}
replicationDelay = {{ replication.replicationDelay }}
{% endif %}
{% if 'threads' in replication %}
threads = {{ replication.threads }}
{% endif %}
{% if 'authGroup' in replication %}
authGroup = {{ replication.authGroup }}
{% endif %}
{% if 'replicatePermissions' in replication %}
replicatePermissions = {{ replication.replicatePermissions }}
{% endif %}
{% if 'mirror' in replication %}
mirror = {{ replication.mirror }}
{% endif %}
{% if 'projects' in replication %}
{% for project in replication.projects %}
projects = {{ project }}
{% endfor %}
{% endif %}
{% if 'push' in replication %}
{% for refspec in replication.push %}
push = {{ refspec }}
{% endfor %}
{% endif %}
{% endfor %}