summaryrefslogtreecommitdiff
path: root/doc/administration/gitaly
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 09:09:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 09:09:34 +0000
commit97f0ae7454597105a27df65ffb772949d9d4f3cb (patch)
tree0bf4888e0e9082c8f168a211390a73a6ae810cef /doc/administration/gitaly
parent5ebc4d92cd5fbb46c627eb04d500384893dbe2b4 (diff)
downloadgitlab-ce-97f0ae7454597105a27df65ffb772949d9d4f3cb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/administration/gitaly')
-rw-r--r--doc/administration/gitaly/praefect.md30
1 files changed, 22 insertions, 8 deletions
diff --git a/doc/administration/gitaly/praefect.md b/doc/administration/gitaly/praefect.md
index 61c3d7a4042..d1d0c358dc6 100644
--- a/doc/administration/gitaly/praefect.md
+++ b/doc/administration/gitaly/praefect.md
@@ -468,12 +468,16 @@ config.
Manual failover is possible by updating `praefect['virtual_storages']` and
nominating a new primary node.
- NOTE: **Note:**: Automatic failover is not yet supported for setups with
- multiple Praefect nodes. There is currently no coordination between Praefect
- nodes, which could result in two Praefect instances thinking two different
- Gitaly nodes are the primary. Follow issue
- [#2547](https://gitlab.com/gitlab-org/gitaly/-/issues/2547) for
- updates.
+1. By default, Praefect will nominate a primary Gitaly node for each
+ shard and store the state of the primary in local memory. This state
+ does not persist across restarts and will cause a split brain
+ if multiple Praefect nodes are used for redundancy.
+
+ To avoid this limitation, enable the SQL election strategy:
+
+ ```ruby
+ praefect['failover_election_strategy'] = 'sql'
+ ```
1. Save the changes to `/etc/gitlab/gitlab.rb` and [reconfigure
Praefect](../restart_gitlab.md#omnibus-gitlab-reconfigure):
@@ -677,8 +681,18 @@ current primary node is found to be unhealthy.
checks fail for the current primary backend Gitaly node, and new primary will
be elected. **Do not use with multiple Praefect nodes!** Using with multiple
Praefect nodes is likely to result in a split brain.
-- **PostgreSQL:** Coming soon. See isse
- [#2547](https://gitlab.com/gitlab-org/gitaly/-/issues/2547) for updates.
+- **PostgreSQL:** Enabled by setting
+ `praefect['failover_election_strategy'] = sql`. This configuration
+ option will allow multiple Praefect nodes to coordinate via the
+ PostgreSQL database to elect a primary Gitaly node. This configuration
+ will cause Praefect nodes to elect a new primary, monitor its health,
+ and elect a new primary if the current one has not been reachable in
+ 10 seconds by a majority of the Praefect nodes.
+
+NOTE: **Note:**: Praefect does not yet account for replication lag on
+the secondaries during the election process, so data loss can occur
+during a failover. Follow issue
+[#2642](https://gitlab.com/gitlab-org/gitaly/-/issues/2642) for updates.
It is likely that we will implement support for Consul, and a cloud native
strategy in the future.