Commit d06f1347 authored by Evan Read's avatar Evan Read

Merge branch 'pks-docs-strong-consistency' into 'master'

Document how to enable strong consistency

See merge request gitlab-org/gitlab!36426
parents 27b88082 c51dc6c1
...@@ -35,8 +35,7 @@ The availability objectives for Gitaly clusters are: ...@@ -35,8 +35,7 @@ The availability objectives for Gitaly clusters are:
Writes are replicated asynchronously. Any writes that have not been replicated Writes are replicated asynchronously. Any writes that have not been replicated
to the newly promoted primary are lost. to the newly promoted primary are lost.
[Strong Consistency](https://gitlab.com/groups/gitlab-org/-/epics/1189) is [Strong consistency](#strong-consistency) can be used to improve this to "no loss".
planned to improve this to "no loss".
- **Recovery Time Objective (RTO):** Less than 10 seconds. - **Recovery Time Objective (RTO):** Less than 10 seconds.
...@@ -877,6 +876,35 @@ Prometheus counter metric. It has two labels: ...@@ -877,6 +876,35 @@ Prometheus counter metric. It has two labels:
They reflect configuration defined for this instance of Praefect. They reflect configuration defined for this instance of Praefect.
## Strong consistency
> Introduced in GitLab 13.1 in [alpha](https://about.gitlab.com/handbook/product/#alpha-beta-ga), disabled by default.
Praefect guarantees eventual consistency by replicating all writes to secondary nodes
after the write to the primary Gitaly node has happened.
Praefect can instead provide strong consistency by creating a transaction and writing
changes to all Gitaly nodes at once. Strong consistency is currently in
[alpha](https://about.gitlab.com/handbook/product/#alpha-beta-ga) and not enabled by
default. For more information, see the
[strong consistency epic](https://gitlab.com/groups/gitlab-org/-/epics/1189).
To enable strong consistency:
- In GitLab 13.2 and later, enable the `:gitaly_reference_transactions` feature flag.
- In GitLab 13.1, enable the `:gitaly_reference_transactions` and `:gitaly_hooks_rpc`
feature flags.
Enabling feature flags requires [access to the Rails console](../feature_flags.md#start-the-gitlab-rails-console).
In the Rails console, enable or disable the flags as required. For example:
```ruby
Feature.enable(:gitaly_reference_transactions)
```
To monitor strong consistency, use the `gitaly_praefect_transactions_total` and
`gitaly_praefect_transactions_delay_seconds` Prometheus counter metrics.
## Automatic failover and leader election ## Automatic failover and leader election
Praefect regularly checks the health of each backend Gitaly node. This Praefect regularly checks the health of each backend Gitaly node. This
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment