Merge "Rename "master" to "primary" in documentation and comments" into stable-3.1
diff --git a/Documentation/backup.txt b/Documentation/backup.txt
index cd247af..7220c74 100644
--- a/Documentation/backup.txt
+++ b/Documentation/backup.txt
@@ -139,11 +139,12 @@
 server is read-only or down as short as possible.
 
 [#cons-backup-read-only]
-=== Turn master read-only for backup
+=== Turn primary server read-only for backup
 
-Make the server read-only before taking the backup. This means read-access
-is still available during backup, because only write operations have to be
-stopped to ensure consistency. This can be implemented using the
+Make the primary server handling write operations read-only before taking the
+backup. This means read-access is still available from replica servers during
+backup, because only write operations have to be stopped to ensure consistency.
+This can be implemented using the
 link:https://gerrit.googlesource.com/plugins/readonly/[_readonly_] plugin.
 
 [#cons-backup-replicate]
@@ -180,11 +181,12 @@
 replica for creating backups.
 
 [#cons-backup-offline]
-=== Take master offline for backup
+=== Take primary server offline for backup
 
-Shutdown the server before taking a backup. This is simple but means downtime
-for the users. Also crons and currently running cron jobs (e.g. repacking
-repositories) which affect the repositories may need to be shut down.
+Shut down the primary server handling write operations before taking a backup.
+This is simple but means downtime for the users. Also crons and currently
+running cron jobs (e.g. repacking repositories) which affect the repositories
+may need to be shut down.
 
 [#backup-methods]
 == Backup methods
diff --git a/Documentation/config-accounts.txt b/Documentation/config-accounts.txt
index 45aa42a..d1fb690 100644
--- a/Documentation/config-accounts.txt
+++ b/Documentation/config-accounts.txt
@@ -386,10 +386,10 @@
 allows to plug in alternate implementations for storing the reviewed
 flags. To replace the storage for reviewed flags a plugin needs to
 implement the link:dev-plugins.html#account-patch-review-store[
-AccountPatchReviewStore] interface. E.g. to support a multi-master
-setup where reviewed flags should be replicated between the master
-nodes one could implement a store for the reviewed flags that is
-based on MySQL with replication.
+AccountPatchReviewStore] interface. E.g. to support a cluster setup with
+multiple primary servers handling write operations where reviewed flags should
+be replicated between the primary nodes one could implement a store for the
+reviewed flags that is based on MySQL with replication.
 
 [[account-sequence]]
 == Account Sequence
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 6dd01fe..cf255f3 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -826,7 +826,8 @@
 +
 Default value is 0 (disabled). It is disabled by default due to the fact
 that change updates are not communicated between Gerrit servers. Hence
-this cache should be disabled in an multi-master/multi-replica setup.
+this cache should be disabled in a cluster setup using multiple primary
+or multiple replica nodes.
 +
 The cache should be flushed whenever the database changes table is modified
 outside of Gerrit.
@@ -1569,7 +1570,8 @@
 +
 Used on Gerrit replica installations. If set to true the Gerrit JVM is
 called with the '--replica' switch, enabling replica mode. If no value is
-set (or any other value), Gerrit defaults to master mode.
+set (or any other value), Gerrit defaults to primary mode enabling write
+operations.
 
 [[container.slave]]container.slave::
 +
@@ -4365,7 +4367,7 @@
 handshake.
 +
 Compression can be especially useful when Gerrit replicas are being used
-for the larger clones and fetches and the master server mostly takes
+for the larger clones and fetches and the primary server mostly takes
 small receive-packs.
 +
 By default, `false`.
diff --git a/Documentation/config-groups.txt b/Documentation/config-groups.txt
index 327cab6..afabbfc 100644
--- a/Documentation/config-groups.txt
+++ b/Documentation/config-groups.txt
@@ -103,7 +103,7 @@
 
 == Replication
 
-In a replicated setting (eg. backups and or master/replica
-configurations), all refs in the `All-Users` project must be copied
-onto all replicas, including `refs/groups/*`, `refs/meta/group-names`
-and `refs/sequences/groups`.
+In a replicated setting (eg. backups and or primary/replica configurations), all
+refs in the `All-Users` project on primary nodes must be copied onto all
+replicas, including `refs/groups/*`, `refs/meta/group-names` and
+`refs/sequences/groups`.
diff --git a/Documentation/config-plugins.txt b/Documentation/config-plugins.txt
index edeec54..464611d 100644
--- a/Documentation/config-plugins.txt
+++ b/Documentation/config-plugins.txt
@@ -797,8 +797,8 @@
 
 This plugin replaces the built-in Gerrit H2 based websession cache with
 a flatfile based implementation. This implementation is shareable
-among multiple Gerrit servers, making it useful for multi-master
-Gerrit installations.
+among multiple Gerrit servers, making it useful for cluster
+Gerrit installations having multiple primary Gerrit nodes.
 
 link:https://gerrit-review.googlesource.com/admin/repos/plugins/websession-flatfile[
 Project] |
diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt
index a2fcd47..11e0666 100644
--- a/Documentation/dev-plugins.txt
+++ b/Documentation/dev-plugins.txt
@@ -2306,7 +2306,8 @@
 volume efficiently.
 
 Gerrit implements this extension point, but plugins may bind another
-implementation, e.g. one that supports multi-master.
+implementation, e.g. one that supports cluster setup with multiple
+primary Gerrit nodes handling write operations.
 
 ----
 DynamicItem.bind(binder(), AccountPatchReviewStore.class)
diff --git a/Documentation/pgm-daemon.txt b/Documentation/pgm-daemon.txt
index 210b1cb..7345d06 100644
--- a/Documentation/pgm-daemon.txt
+++ b/Documentation/pgm-daemon.txt
@@ -81,7 +81,7 @@
 
 == KNOWN ISSUES
 Replica daemon caches can quickly become out of date when modifications
-are made on the master.  The following configuration is suggested in
+are made on the primary node.  The following configuration is suggested in
 a replica to reduce the maxAge for each cache entry, so that changes
 are recognized in a reasonable period of time:
 
@@ -106,7 +106,7 @@
   maxAge = 5 min
 ----
 
-Automatic cache coherency between master and replica systems is
+Automatic cache coherency between primary and replica systems is
 planned to be implemented in a future version.
 
 GERRIT
diff --git a/contrib/hooks/post-receive-move-tmp-refs b/contrib/hooks/post-receive-move-tmp-refs
index c99a3e5..fa0684f 100755
--- a/contrib/hooks/post-receive-move-tmp-refs
+++ b/contrib/hooks/post-receive-move-tmp-refs
@@ -15,10 +15,10 @@
 # limitations under the License.
 # --------------------------------------------------------
 # 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.
+# hosted by a gerrit replica which are updated by push replication from the
+# corresponding gerrit primary node.
 #
-# In the gerrit master configure the replication plugin to push changes from
+# In the gerrit primary node configure the replication plugin to push changes from
 # refs/changes/ to refs/tmp/changes/
 #   remote.NAME.push = +refs/changes/*:refs/tmp/changes/*
 #   remote.NAME.push = +refs/heads/*:refs/heads/*
@@ -26,26 +26,26 @@
 # And if it's a Gerrit mirror:
 #   remote.NAME.push = +refs/meta/*:refs/meta/*
 #
-# In the replicated repository in the gerrit slave configure
+# In the replicated repository in the gerrit replica configure
 #    receive.hideRefs = refs/changes/
 # in order to not advertise the big number of refs in this namespace when
-# the gerrit master's replication plugin is pushing a change
+# the gerrit primary's replication plugin is pushing a change
 #
 # Whenever a ref under refs/tmp/changes/ is arriving this hook will move it
 # to refs/changes/. This helps to avoid the large overhead of advertising all
-# refs/changes/ refs to the gerrit master when it replicates changes to the
-# slave..
+# refs/changes/ refs to the gerrit primary when it replicates changes to the
+# replica.
 #
 # Make this script executable then link to it in the repository you would like
 # to use it in.
 #   cd /path/to/your/repository.git
 #   ln -sf <shared hooks directory>/post-receive-move-tmp-refs hooks/post-receive
 #
-# If you want to use this by default for repositories on the Gerrit slave you
+# If you want to use this by default for repositories on the Gerrit replica you
 # can set up a git template directory $TEMPLATE_DIR/hooks/post-receive and
 # configure init.templateDir in the ~/.gitconfig of the user that receives the
 # replication on the mirror host. That way when a new repository is created on
-# the master and hence on the mirror (if configured that way) it will
+# the primary and hence on the mirror (if configured that way) it will
 # automatically have the "tmp-refs" commit hook installed.
 # See https://git-scm.com/docs/git-init#_template_directory for details.
 
diff --git a/java/com/google/gerrit/server/ExceptionHook.java b/java/com/google/gerrit/server/ExceptionHook.java
index ea76330..a0d98d2 100644
--- a/java/com/google/gerrit/server/ExceptionHook.java
+++ b/java/com/google/gerrit/server/ExceptionHook.java
@@ -19,11 +19,11 @@
 /**
  * Allows implementors to control how certain exceptions should be handled.
  *
- * <p>This interface is intended to be implemented for multi-master setups to control the behavior
- * for handling exceptions that are thrown by a lower layer that handles the consensus and
- * synchronization between different server nodes. E.g. if an operation fails because consensus for
- * a Git update could not be achieved (e.g. due to slow responding server nodes) this interface can
- * be used to retry the request instead of failing it immediately.
+ * <p>This interface is intended to be implemented for cluster setups with multiple primary nodes to
+ * control the behavior for handling exceptions that are thrown by a lower layer that handles the
+ * consensus and synchronization between different server nodes. E.g. if an operation fails because
+ * consensus for a Git update could not be achieved (e.g. due to slow responding server nodes) this
+ * interface can be used to retry the request instead of failing it immediately.
  */
 @ExtensionPoint
 public interface ExceptionHook {
diff --git a/java/com/google/gerrit/server/change/AccountPatchReviewStore.java b/java/com/google/gerrit/server/change/AccountPatchReviewStore.java
index d6bb164..8da2a90 100644
--- a/java/com/google/gerrit/server/change/AccountPatchReviewStore.java
+++ b/java/com/google/gerrit/server/change/AccountPatchReviewStore.java
@@ -30,7 +30,8 @@
  * number of reviewed flags is growing without bound. The store must be able handle this data volume
  * efficiently.
  *
- * <p>For a multi-master setup the store must replicate the data between the masters.
+ * <p>For a cluster setups with multiple primary nodes the store must replicate the data between the
+ * primary servers.
  */
 public interface AccountPatchReviewStore {
 
diff --git a/java/com/google/gerrit/server/submit/MergeOp.java b/java/com/google/gerrit/server/submit/MergeOp.java
index a06027a..adb75a4 100644
--- a/java/com/google/gerrit/server/submit/MergeOp.java
+++ b/java/com/google/gerrit/server/submit/MergeOp.java
@@ -828,9 +828,9 @@
         }
 
         // The patch set ref is not found but we want to merge the change. We can't safely do that
-        // if the patch set ref is missing. In a multi-master setup this can indicate a replication
-        // lag (e.g. the change meta data was already replicated, but the replication of the patch
-        // set ref is still pending).
+        // if the patch set ref is missing. In a cluster setups with multiple primary nodes this can
+        // indicate a replication lag (e.g. the change meta data was already replicated, but the
+        // replication of the patch set ref is still pending).
         commitStatus.logProblem(
             changeId,
             "Patch set ref "
diff --git a/java/com/google/gerrit/sshd/SshDaemon.java b/java/com/google/gerrit/sshd/SshDaemon.java
index 7512b3e..da09087 100644
--- a/java/com/google/gerrit/sshd/SshDaemon.java
+++ b/java/com/google/gerrit/sshd/SshDaemon.java
@@ -638,10 +638,9 @@
     // However, if there are CPU in abundance and the server is reachable through
     // slow networks, gits with huge amount of refs can benefit from SSH-compression
     // since git does not compress the ref announcement during the handshake.
-    //
-    // Compression can be especially useful when Gerrit slaves are being used
-    // for the larger clones and fetches and the master server mostly takes small
-    // receive-packs.
+    // Compression can be especially useful when Gerrit replica are being used
+    // for the larger clones and fetches and the primary server handling write
+    // operations mostly takes small receive-packs.
 
     if (enableCompression) {
       compressionFactories.add(BuiltinCompressions.zlib);
diff --git a/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java b/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java
index 464f3ff..29574c4 100644
--- a/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java
+++ b/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java
@@ -306,7 +306,7 @@
     requestScopeOperations.setApiUser(user.id());
 
     // watch keyword in project as user
-    watch(watchedProject, "multimaster");
+    watch(watchedProject, "multiprimary");
 
     // push a change with keyword -> should trigger email notification
     requestScopeOperations.setApiUser(admin.id());
@@ -314,7 +314,7 @@
         cloneProject(Project.nameKey(watchedProject), admin);
     PushOneCommit.Result r =
         pushFactory
-            .create(admin.newIdent(), watchedRepo, "Document multimaster setup", "a.txt", "a1")
+            .create(admin.newIdent(), watchedRepo, "Document multiprimary setup", "a.txt", "a1")
             .to("refs/for/master");
     r.assertOkStatus();
 
@@ -323,7 +323,7 @@
     assertThat(messages).hasSize(1);
     Message m = messages.get(0);
     assertThat(m.rcpt()).containsExactly(user.getEmailAddress());
-    assertThat(m.body()).contains("Change subject: Document multimaster setup\n");
+    assertThat(m.body()).contains("Change subject: Document multiprimary setup\n");
     assertThat(m.body()).contains("Gerrit-PatchSet: 1\n");
     sender.clear();
 
@@ -418,7 +418,7 @@
     requestScopeOperations.setApiUser(user.id());
 
     // watch keyword in project as user
-    watch(allProjects.get(), "multimaster");
+    watch(allProjects.get(), "multiprimary");
 
     // push a change with keyword to any project -> should trigger email
     // notification
@@ -426,7 +426,7 @@
     TestRepository<InMemoryRepository> anyRepo = cloneProject(Project.nameKey(anyProject), admin);
     PushOneCommit.Result r =
         pushFactory
-            .create(admin.newIdent(), anyRepo, "Document multimaster setup", "a.txt", "a1")
+            .create(admin.newIdent(), anyRepo, "Document multiprimary setup", "a.txt", "a1")
             .to("refs/for/master");
     r.assertOkStatus();
 
@@ -435,7 +435,7 @@
     assertThat(messages).hasSize(1);
     Message m = messages.get(0);
     assertThat(m.rcpt()).containsExactly(user.getEmailAddress());
-    assertThat(m.body()).contains("Change subject: Document multimaster setup\n");
+    assertThat(m.body()).contains("Change subject: Document multiprimary setup\n");
     assertThat(m.body()).contains("Gerrit-PatchSet: 1\n");
     sender.clear();