Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-26Prevent usage of other election strategies than per_repositorySami Hiltunen
Praefect's legacy election strategies have been deprecated in 13.12 and are scheduled for removal in 14.0. This commit switches the `per_repository` to be the default election strategy and ignores the `failover.election_strategy` configuration key. As there are still some tests in Gitaly's repo and in GitLab's repo which are not configured to use the database, there's an additional configuration key added which allows for still configuring the other election strategies. Changelog: removed
2020-11-17hook up per repository router and electorSami Hiltunen
This adds a config option to enable the per repository elector and router. When the `per_repository` elector is configured, the per repository primary elector and router are enabled and node manager is disabled. The node manager is still created and passed as a dependency in Praefect's info and server serivces as they haven't been updated to support repository specific primaries yet. While the configuration option is added, there are still follow ups to address before the components are safe to use in production. For example, creating repositories is not supported yet until a follow up issue is addressed. The changes introduced here are useful for continued local development repository specific primaries and features dependent on them such as the variable replication factor.
2020-09-02automatic repository reconciliationSami Hiltunen
Replication jobs are currently only attempted three times at maximum until they are dropped. After a replication job is dropped, its changes are not going to be replicated until another replication job is triggered form another mutator operation or an administrator runs reconcile manually. Repositories can stay outdated for an indefinite time. This commit addresses the problem by adding a background goroutine that automatically schedules replication jobs from storages which have a fully up to date copy of the repository to storages with outdated copies of the repository. Replication jobs are only scheduled from and to storages which are currently healthy to avoid scheduling replication jobs that are not going to be successfully completed. If there is a replication job already targeting the repository, a redundant reconciliation job won't be scheduled.
2020-08-07configurable replication queue batch sizeSami Hiltunen
Adds a configuration option for controlling the replicator's job dequeueing batch size.
2020-07-30remove virtual storage wide read-only modeSami Hiltunen
With the introduction of per repository read-only mode, this commit removes the previous virtual storage wide read-only mode implementation.
2020-07-22Remove Praefect primary from configPaul Okstad
2020-07-01Add TLS support to PraefectPavlo Strokov
Praefect allowed to use TLS address to listen on in combination with certificate and its key to be used for it. 'metadata' package refactored, so TLS address can be passed into the Gitaly. Documentation fixed and example file filled with proper vals. Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/1698
2020-05-29failover: Default to enabling SQL strategyZeger-Jan van de Weg
Given the SQL strategy is a reasonable default, and tested well enough, this change makes the SQL strategy the preferred strategy. This was `local`, which creates dataloss scenarios when multiple Praefects are behind a load balancer. Additionally, this changes behaviour around the read only feature. This would default to being enabled. Currently availability is favoured over consistency. Now this is flipped. Fixes: https://gitlab.com/gitlab-org/gitaly/-/issues/2682
2020-05-27Praefect graceful stopPavlo Strokov
In order to reduce usage of global configuration Bootstrap struct changed to accept duration as parameter. That was a cause of adding a new configuration setting to praefect configuration file, because previously it used default value of 1m configured for gitaly.
2020-05-18Replace read-only feature flag with a config toggleSami Hiltunen
Removes the feature-flag controlling read-only enforcement. The feature flag only controlled enforcement in RPCs, making future upgrades more difficult as some storages could already be in read-only mode when the feature flag is removed. The feature flag is replaced with a config toggle that also controls whether the storages should be set read-only on a failover.
2020-04-09Add SQL-based election strategyStan Hu
This commit adds the following strategy to enable redundant Praefect nodes to run simultaenously: 1. Every Praefect node periodically (every second) performs a health check RPC with a Gitaly node. 2. For each node, Praefect updates a row in a new table (`node_status`) with the following information: a. The name of the Praefect instance (`praefect_name`) b. The name of the virtual storage name (`shard_name`) c. The name of the Gitaly storage name (`storage_name`) d. The timestamp of the last time Praefect tried to reach that node (`last_contact_attempt_at`) e. The timestamp of the last successful health check (`last_seen_active_at`) 3. Periodically every Praefect node does a `SELECT` from `node_status` to determine **healthy nodes**. A healthy node is defined by: a. A node that has a recent successful error check (e.g. one in the last 10 s). b. A majority of the available Praefect nodes have entries that match the two above. 4. To determine the majority, we use a lightweight service discovery protocol: a Praefect node is deemed a voting member if the `praefect_name` has a recent `last_contact_attempt_at` in the `node_status` table. The name is derived from a combination of the hostname and listening port/socket. 5. The primary of each shard is listed in the `shard_primaries`. If the current primary is in the healthy node list, then no election needs to be done. 6. Otherwise, if there is no primary or it is unhealthy, any Praefect node can elect a new primary by choosing candidate from the healthy node list and inserting a row into the table. Closes https://gitlab.com/gitlab-org/gitaly/-/issues/2547
2020-02-22Fix example Praefect config file for virtual storage changesStan Hu
As discussed in https://gitlab.com/gitlab-org/gitaly/issues/2118 and implemented in https://gitlab.com/gitlab-org/gitaly/-/merge_requests/1606, Praefect now supports multiple virtual storages, and the root-level `virtual_storage_name` is now deprecated. This change only updates the sample config file to reflect reality.
2019-10-31Adding sentry config to praefectJohn Cai
Refactored configs so that both praefect and gitaly can share logging and sentry config structs
2019-10-10Add virtual storage name to praefect configJohn Cai
2019-10-08Adding auth to praefectJohn Cai
2019-09-18Explicitly designate primary and replica nodes in praefect configJohn Cai
2019-08-29Update example praefect configZeger-Jan van de Weg
2019-08-22Realtime replicationJohn Cai
2019-07-19Handle failover by catching SIGUSR1 signal AND other refactorsJohn Cai
2019-06-04Praefect configuration fixesZeger-Jan van de Weg
Today I've tried to determine the state of the praefect project, and had to find out a couple of things which I tried to make easier for the ones that will do the same later.
2019-03-08Support socket paths for praefectZeger-Jan van de Weg
When investigating the integration of praefect in the GDK and Omnibus it seemed that using sockets is much more convenient. From a configuration perspective the behaviour of Gitaly is largely copied. Closes: https://gitlab.com/gitlab-org/gitaly/issues/1523
2019-03-07Enable Prometheus for praefectZeger-Jan van de Weg
Eventhough the listeners were added before, it was chosen to keep that MR more focussed and the config for the listener was to be added later. This commit adds the configuration option, in line with how Gitaly does it.
2019-02-27Make logging configurableZeger-Jan van de Weg
Futher a few style improvements were added, and logging is now configurable in the same way Gitaly is.
2019-02-22Create Praefect commandZeger-Jan van de Weg
By introducting a new command, the pass through proxy gets an execution path. To allow for manual testing, but also for, probably more important; getting started with integrating into the GitLab architecture. For logging we default to logrus, but these aren't structured yet. Which should be improved later. Config is added too, by parsing a TOML file. The path to this file is passed as first argument to the praefect binary. The output is JSON by default and not yet configurable. OS signals are handled too, and allow for a Shutdown of the server. The basic observability was added too, but on the proxy layer this will not yield too much, other than tracing.