-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Today a snapshot repository does not have a well-defined identity. It can be reregistered with a different cluster under a different name, and can even be registered with multiple clusters in readonly mode. This presents problems for cases where we need to refer to a specific snapshot in a globally-unique fashion. Today we rely on the repository being registered under the same name on every cluster, but this is not a safe assumption. This commit adds a UUID that can be used to uniquely identify a repository. The UUID is stored in the top-level index blob, represented by `RepositoryData`, and is also usually copied into the `RepositoryMetadata` that represents the repository in the cluster state. The repository UUID is exposed in the get-repositories API; other more meaningful consumers will be added in due course.
- Loading branch information
1 parent
f31f464
commit e5a15d4
Showing
23 changed files
with
525 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...spec/src/main/resources/rest-api-spec/test/snapshot.get_repository/20_repository_uuid.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
"Get repository returns UUID": | ||
- skip: | ||
version: " - 7.99.99" | ||
reason: repository UUIDs introduced in 8.0.0 | ||
|
||
- do: | ||
snapshot.create_repository: | ||
repository: test_repo_uuid_1 | ||
body: | ||
type: fs | ||
settings: | ||
location: "test_repo_uuid_1_loc" | ||
|
||
- do: | ||
indices.create: | ||
index: test_index | ||
body: | ||
settings: | ||
number_of_shards: 1 | ||
number_of_replicas: 0 | ||
|
||
- do: | ||
snapshot.create: | ||
repository: test_repo_uuid_1 | ||
snapshot: test_snapshot | ||
wait_for_completion: true | ||
|
||
- do: | ||
snapshot.get_repository: {} | ||
|
||
- match: { test_repo_uuid_1.type: fs } | ||
- is_true: test_repo_uuid_1.uuid | ||
- set: { test_repo_uuid_1.uuid: repo_uuid } | ||
- match: { test_repo_uuid_1.settings.location: "test_repo_uuid_1_loc" } | ||
- is_false: test_repo_uuid_1.generation | ||
- is_false: test_repo_uuid_1.pending_generation | ||
|
||
- do: | ||
snapshot.delete_repository: | ||
repository: test_repo_uuid_1 | ||
|
||
- do: | ||
snapshot.create_repository: | ||
repository: test_repo_uuid_1_copy | ||
body: | ||
type: fs | ||
settings: | ||
location: "test_repo_uuid_1_loc" | ||
|
||
- do: | ||
snapshot.get_repository: {} | ||
|
||
- match: { test_repo_uuid_1_copy.uuid: $repo_uuid } | ||
|
||
- do: | ||
snapshot.delete_repository: | ||
repository: test_repo_uuid_1_copy | ||
|
||
- do: | ||
snapshot.create_repository: | ||
repository: test_repo_uuid_1_ro | ||
body: | ||
type: fs | ||
settings: | ||
location: "test_repo_uuid_1_loc" | ||
read_only: true | ||
|
||
- do: | ||
snapshot.get_repository: {} | ||
|
||
- match: { test_repo_uuid_1_ro.uuid: $repo_uuid } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.