forked from elastic/elasticsearch
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recovery: Fix wrong reused file bytes in Recovery API reports
Simple snapshot.restore test case that also exposes the bug mentioned in elastic#11876 Fix elastic#11876 Closes elastic#11965
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
rest-api-spec/src/main/resources/rest-api-spec/test/snapshot.restore/10_basic.yaml
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,57 @@ | ||
--- | ||
setup: | ||
|
||
- do: | ||
snapshot.create_repository: | ||
repository: test_repo1 | ||
body: | ||
type: fs | ||
settings: | ||
location: "test_repo1" | ||
|
||
- do: | ||
indices.create: | ||
index: test_index | ||
body: | ||
settings: | ||
number_of_shards: 1 | ||
number_of_replicas: 1 | ||
|
||
- do: | ||
cluster.health: | ||
wait_for_status: yellow | ||
|
||
--- | ||
"Create a snapshot and then restore it": | ||
|
||
- do: | ||
snapshot.create: | ||
repository: test_repo1 | ||
snapshot: test_snapshot | ||
wait_for_completion: true | ||
|
||
- match: { snapshot.snapshot: test_snapshot } | ||
- match: { snapshot.state : SUCCESS } | ||
- match: { snapshot.shards.successful: 1 } | ||
- match: { snapshot.shards.failed : 0 } | ||
|
||
- do: | ||
indices.close: | ||
index : test_index | ||
|
||
- do: | ||
snapshot.restore: | ||
repository: test_repo1 | ||
snapshot: test_snapshot | ||
wait_for_completion: true | ||
|
||
- do: | ||
indices.recovery: | ||
index: test_index | ||
|
||
- match: { test_index.shards.0.type: SNAPSHOT } | ||
- match: { test_index.shards.0.stage: DONE } | ||
- match: { test_index.shards.0.index.files.recovered: 1} | ||
- gt: { test_index.shards.0.index.size.recovered_in_bytes: 0} | ||
- match: { test_index.shards.0.index.files.reused: 0} | ||
- match: { test_index.shards.0.index.size.reused_in_bytes: 0} |
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