Add peer recoveries using snapshot files when possible (#76237)

This commit adds peer recoveries from snapshots. It allows establishing a replica by downloading file data from a snapshot rather than transferring the data from the primary. 

Enabling this feature is done on the repository definition. Repositories having the setting `use_for_peer_recovery=true` will be consulted to find a good snapshot when recovering a shard.

Relates #73496
This commit is contained in:
Francisco Fernández Castaño 2021-08-13 10:42:16 +02:00 committed by GitHub
parent ff5df64a42
commit 2ebe5cd075
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 2566 additions and 131 deletions

View file

@ -82,9 +82,21 @@ When `indices.recovery.use_snapshots` is `false` {es} will construct this new
copy by transferring the index data from the current primary. When this setting
is `true` {es} will attempt to copy the index data from a recent snapshot
first, and will only copy data from the primary if it cannot identify a
suitable snapshot.
suitable snapshot. Defaults to `true`.
+
Setting this option to `true` reduces your operating costs if your cluster runs
in an environment where the node-to-node data transfer costs are higher than
the costs of recovering data from a snapshot. It also reduces the amount of
work that the primary must do during a recovery.
+
Additionally, repositories having the setting `use_for_peer_recovery=true`
will be consulted to find a good snapshot when recovering a shard. If none
of the registered repositories have this setting defined, index files will
be recovered from the source node.
`indices.recovery.max_concurrent_snapshot_file_downloads`::
(<<cluster-update-settings,Dynamic>>, Expert) Number of snapshot file downloads requests
sent in parallel to the target node for each recovery. Defaults to `5`.
+
Do not increase this setting without carefully verifying that your cluster has
the resources available to handle the extra load that will result.