Age | Commit message (Collapse) | Author |
|
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
|
|
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.
|
|
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.
|
|
Adds a configuration option for controlling the replicator's job
dequeueing batch size.
|
|
With the introduction of per repository read-only mode, this commit
removes the previous virtual storage wide read-only mode
implementation.
|
|
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
Refactored configs so that both praefect and gitaly can share logging
and sentry config structs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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
|
|
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.
|
|
Futher a few style improvements were added, and logging is now
configurable in the same way Gitaly is.
|
|
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.
|