3 Commits

Author SHA1 Message Date
Matthias Sohn
d8182babb4 Rename "master" to "primary" in documentation and comments
Per
https://en.wikipedia.org/wiki/Master/slave_(technology)#Terminology_concerns
the use of "master" and "slave" is considered offsensive in some circles.

This is a followup for
https://gerrit-review.googlesource.com/c/gerrit/+/238661
to also rename "master" to "primary" and "multi-master" to
"cluster setup with multiple primary nodes".

Also fix a few remaining occurrences of "slave" to "replica".

Change-Id: I8cd73220e2428d78dcd8205fbd826b4ebdcb2372
2019-12-10 17:20:11 +01:00
Sven Selberg
925b5df4d1 post-receive-move-tmp-refs: adapt for NoteDb replication
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
2019-09-25 14:04:30 +02:00
Matthias Sohn
375e974935 post-receive hook to enable hiding refs/changes during replication
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
2019-02-13 15:20:55 +01:00