Skip to content

Commit 6b1861a

Browse files
authored
Fix interchanged formats of total_indexing_buffer_in_bytes and total_indexing_buffer (#17070)
* Fix total_indexing_buffer_in_bytes and total_indexing_buffer formats swapped in nodes API Signed-off-by: hye-on <[email protected]> * Move changelog entry to CHANGELOG-3.0 and update PR reference to #17070 Signed-off-by: hye-on <[email protected]> --------- Signed-off-by: hye-on <[email protected]>
1 parent f5c89c1 commit 6b1861a

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

CHANGELOG-3.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5050
- Fix 'org.apache.hc.core5.http.ParseException: Invalid protocol version' under JDK 16+ ([#4827](https://github.com/opensearch-project/OpenSearch/pull/4827))
5151
- Fix compression support for h2c protocol ([#4944](https://github.com/opensearch-project/OpenSearch/pull/4944))
5252
- Don't over-allocate in HeapBufferedAsyncEntityConsumer in order to consume the response ([#9993](https://github.com/opensearch-project/OpenSearch/pull/9993))
53+
- Fix swapped field formats in nodes API where `total_indexing_buffer_in_bytes` and `total_indexing_buffer` values were reversed ([#17070](https://github.com/opensearch-project/OpenSearch/pull/17070))
54+
5355

5456
### Security
5557

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
"Test total indexing buffer fields should have correct formats":
3+
- skip:
4+
version: " - 2.99.99"
5+
reason: "this change is added in 3.0.0"
6+
features: [arbitrary_key]
7+
8+
- do:
9+
nodes.info: {}
10+
- set:
11+
nodes._arbitrary_key_: node_id
12+
13+
- do:
14+
nodes.info:
15+
human: true
16+
filter_path: "nodes.*.total_indexing_buffer*"
17+
18+
- gte: { nodes.$node_id.total_indexing_buffer_in_bytes: 0 }
19+
20+
- match:
21+
nodes.$node_id.total_indexing_buffer: /^\d+(\.\d+)?(b|kb|mb|gb|tb|pb)$/

server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
9898
builder.field("build_type", nodeInfo.getBuild().type().displayName());
9999
builder.field("build_hash", nodeInfo.getBuild().hash());
100100
if (nodeInfo.getTotalIndexingBuffer() != null) {
101-
builder.humanReadableField("total_indexing_buffer", "total_indexing_buffer_in_bytes", nodeInfo.getTotalIndexingBuffer());
101+
builder.humanReadableField("total_indexing_buffer_in_bytes", "total_indexing_buffer", nodeInfo.getTotalIndexingBuffer());
102102
}
103103

104104
builder.startArray("roles");

0 commit comments

Comments
 (0)