Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Recovery API support detailed params #29076

Merged
merged 7 commits into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/indices/recovery.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Response:
}
--------------------------------------------------
// TESTRESPONSE[s/"source" : \{[^}]*\}/"source" : $body.$_path/]
// TESTRESPONSE[s/"details" : \[[^\]]*\]//]
// TESTRESPONSE[s/"details" : \[[^\]]*\]/"details" : $body.$_path/]
// TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$_path/]
// TESTRESPONSE[s/: "[^"]*"/: $body.$_path/]
////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,28 @@
index: [v*]

- match: { $body: {} }
---
"Indices recovery test with detailed parameter":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will have to skip this test for versions that don't have this fix.

- skip:
version: " - 7.9.99"
reason: bug with detailed parameter fixed in 8.0

- do:
indices.create:
index: test_3
body:
settings:
index:
number_of_replicas: 0

- do:
cluster.health:
wait_for_status: green

- do:
indices.recovery:
index: [test_3]
human: true
detailed: true

- match: { test_3.shards.0.index.files.details: [] }
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ public synchronized XContentBuilder toXContent(XContentBuilder builder, Params p
builder.field(Fields.REUSED, reusedFileCount());
builder.field(Fields.RECOVERED, recoveredFileCount());
builder.field(Fields.PERCENT, String.format(Locale.ROOT, "%1.1f%%", recoveredFilesPercent()));
if (params.paramAsBoolean("details", false)) {
if (params.paramAsBoolean("detailed", false)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only change that we need to do in this class

builder.startArray(Fields.DETAILS);
for (File file : fileDetails.values()) {
file.toXContent(builder, params);
Expand Down