Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Removed

### Fixed
- Fix bytes parameter on `_cat/recovery` ([#17598](https://github.com/opensearch-project/OpenSearch/pull/17598))

### Security

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
"Test cat recovery output":
- skip:
version: " - 2.99.99"
reason: Output format changed in 3.0

- do:
cat.recovery: {}
Expand Down Expand Up @@ -35,10 +38,10 @@
\d+ \s+ # files_recovered
\d+\.\d+% \s+ # files_percent
\d+ \s+ # files_total
\d+ \s+ # bytes
\d+ \s+ # bytes_recovered
(\d+|\d+[.]\d+)(kb|b) \s+ # bytes
(\d+|\d+[.]\d+)(kb|b) \s+ # bytes_recovered
\d+\.\d+% \s+ # bytes_percent
\d+ \s+ # bytes_total
(\d+|\d+[.]\d+)(kb|b) \s+ # bytes_total
-?\d+ \s+ # translog_ops
\d+ \s+ # translog_ops_recovered
-?\d+\.\d+% # translog_ops_percent
Expand All @@ -56,7 +59,7 @@
(
\d \s+ # shard
((\S+\s?){1,10})\s+ # source_node
\d+ # bytes
(\d+|\d+[.]\d+)(kb|b) # bytes
\n
)+
$/
Expand All @@ -71,16 +74,16 @@
(
\d \s+ # shard
((\S+\s?){1,10})\s+ # target_node
\d+ # bytes
(\d+|\d+[.]\d+)(kb|b) # bytes
\n
)+
$/

---
"Test cat recovery output for closed index":
- skip:
version: " - 7.1.99"
reason: closed indices are replicated starting version 7.2.0
version: " - 2.99.99"
reason: Output format changed in 3.0

- do:
indices.create:
Expand Down Expand Up @@ -122,10 +125,10 @@
\d+ \s+ # files_recovered
\d+\.\d+% \s+ # files_percent
\d+ \s+ # files_total
\d+ \s+ # bytes
\d+ \s+ # bytes_recovered
(\d+|\d+[.]\d+)(kb|b) \s+ # bytes
(\d+|\d+[.]\d+)(kb|b) \s+ # bytes_recovered
\d+\.\d+% \s+ # bytes_percent
\d+ \s+ # bytes_total
(\d+|\d+[.]\d+)(kb|b) \s+ # bytes_total
0 \s+ # translog_ops (always 0 for closed indices)
0 \s+ # translog_ops_recovered (always 0 for closed indices)
100\.0% # translog_ops_percent (always 100.0% for closed indices)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.xcontent.XContentOpenSearchExtension;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.unit.ByteSizeValue;
import org.opensearch.indices.recovery.RecoveryState;
import org.opensearch.rest.RestRequest;
import org.opensearch.rest.RestResponse;
Expand Down Expand Up @@ -196,10 +197,10 @@ public int compare(RecoveryState o1, RecoveryState o2) {
t.addCell(state.getIndex().recoveredFileCount());
t.addCell(String.format(Locale.ROOT, "%1.1f%%", state.getIndex().recoveredFilesPercent()));
t.addCell(state.getIndex().totalFileCount());
t.addCell(state.getIndex().totalRecoverBytes());
t.addCell(state.getIndex().recoveredBytes());
t.addCell(new ByteSizeValue(state.getIndex().totalRecoverBytes()));
t.addCell(new ByteSizeValue(state.getIndex().recoveredBytes()));
t.addCell(String.format(Locale.ROOT, "%1.1f%%", state.getIndex().recoveredBytesPercent()));
t.addCell(state.getIndex().totalBytes());
t.addCell(new ByteSizeValue(state.getIndex().totalBytes()));
t.addCell(state.getTranslog().totalOperations());
t.addCell(state.getTranslog().recoveredOperations());
t.addCell(String.format(Locale.ROOT, "%1.1f%%", state.getTranslog().recoveredPercent()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.xcontent.XContentOpenSearchExtension;
import org.opensearch.core.action.support.DefaultShardOperationFailedException;
import org.opensearch.core.common.unit.ByteSizeValue;
import org.opensearch.core.index.Index;
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.indices.recovery.RecoveryState;
Expand Down Expand Up @@ -186,10 +187,10 @@ public void testRestRecoveryAction() {
state.getIndex().recoveredFileCount(),
percent(state.getIndex().recoveredFilesPercent()),
state.getIndex().totalFileCount(),
state.getIndex().totalRecoverBytes(),
state.getIndex().recoveredBytes(),
new ByteSizeValue(state.getIndex().totalRecoverBytes()),
new ByteSizeValue(state.getIndex().recoveredBytes()),
percent(state.getIndex().recoveredBytesPercent()),
state.getIndex().totalBytes(),
new ByteSizeValue(state.getIndex().totalBytes()),
state.getTranslog().totalOperations(),
state.getTranslog().recoveredOperations(),
percent(state.getTranslog().recoveredPercent())
Expand Down
Loading