The hook required oldrev to be NULL_SHA1, that the update was a
creation, but NoteDb refs, $CHANGE_REF/meta, can also be updated.
This would cause NoteDb to be stale on the mirror since the
post-receive hook would only be run for the initial creation of
the ref and not for updates.
Add suggestion to add refs/meta/* to refspecs.
Change-Id: I8e2612880e7c67b0b9281e73d9880484fdf4d056
In the gerrit master configure the replication plugin to push changes
from refs/changes/ to refs/tmp/changes/:
remote.NAME.push = +refs/changes/*:refs/tmp/changes/*
Install this hook script as post-receive hook in replicated repositories
hosted by a gerrit slave which are updated by push replication from
the corresponding gerrit master.
In the slave repository configure
receive.hideRefs = refs/changes/
in order to not advertise the big number of refs in this namespace
when replication is pushing another change.
Whenever a ref arrives under refs/tmp/changes/ this git post-receive
hook will move it to refs/changes/. This helps to avoid the large
overhead of receive-pack advertising all refs/changes/ refs when
the gerrit master pushes a pack.
We observed a speedup by a factor of 10 when using this replication
strategy for replication of a large repository with >400k refs across
a WAN link from Germany to Canada.
Change-Id: I6115c1ddbcb8e39cc0bdea999262287a9dc36743