Hello everyone,
I am trying to setup a Gerrit mirror with pull replication using https refering example from
I have an existing QA master with some repos and I have setup a mirror with pull replication using above example.
replication.config on mirror
[gerrit]
autoReload = true
replicateOnStartup = true
[replication]
excludeRefs = ^refs/users/\\d\\d/\\d+/edit-\\d+/\\d+$
lockErrorMaxRetries = 5
maxRetries = 100
useCGitClient = false
consumeStreamEvents = false
syncRefs="ALL REFS ASYNC"
maxApiPayloadSize=40000
[remote "gerrit-master"]
url = http://master-ip:port/${name}.git
apiUrl = http://master-ip:port
fetch = +refs/*:refs/*
mirror = true
timeout = 60 # In seconds
connectionTimeout = 120000 # In mseconds
rescheduleDelay = 15
replicationDelay = 1
threads = 4
createMissingRepositories = true
replicateProjectDeletions = true
replicateHiddenProjects = true
tagopt= --no-tags
replication.config on master
[gerrit]
autoReload = true
replicateOnStartup = false
[replication]
excludeRefs = ^refs/users/\\d\\d/\\d+/edit-\\d+/\\d+$
lockErrorMaxRetries = 5
maxRetries = 100
useCGitClient = false
consumeStreamEvents = false
syncRefs="ALL REFS ASYNC"
maxApiPayloadSize=40000
[remote "mirror-http-1"]
url = http://mirror-ip:port/${name}.git
fetch = +refs/*:refs/*
mirror = true
timeout = 60 # In seconds
connectionTimeout = 120000 # In mseconds
rescheduleDelay = 15
replicationDelay = 1
threads = 4
createMissingRepositories = true
replicateProjectDeletions = true
replicateHiddenProjects = true
tagopt= --no-tags
And when I start replication, I see that All-Projects and All-Users repository is getting replicated from mirror to master (please see below logs highlighted in red).
We lost all account from the test master and we had lost access to the test master which was resolved later using backups.
[2025-02-14 14:22:56,036] scheduling replication http://mirror-ip:port/All-Projects.git:..all.. => All-Projects
[2025-02-14 14:22:56,064] scheduled [bd167ee4] fetch http://mirror-ip:port/All-Projects.git []:..all.. => All-Projects to run after 1s
[2025-02-14 14:22:57,069] [bd167ee4] ASYNC replication from http://mirror-ip:port/All-Projects.git started for refs [[..all..]] ...
[2025-02-14 14:22:57,133] [bd167ee4] Fetch references [+refs/*:refs/*] from http://mirror-ip:port/All-Projects.git
[2025-02-14 14:22:57,313] [bd167ee4] Replication from http://mirror-ip:port/All-Projects.git completed in 241ms, 1027ms delay, 0 retries
I have some questions which I am not able to find answers for by reading documentation:
1. Do we need to have replication.config and pull-replication plugin on both master and mirror?
2. If we need replication.config on master as well, then what should be the configuration?
Are there any specific settings that need to be done on mirror only and not on master?
3. If we have replication.config on both master and mirror, what configuration tells that master should not pull from mirror?