Skip to content

[BUG] NodesInfoResponse serializes total_indexing_buffer and total_indexing_buffer_in_bytes swapped #16910

Closed
@Xtansia

Description

@Xtansia

Describe the bug

When retrieving node info total_indexing_buffer_in_bytes should be the raw byte count (e.g. 53687091) and total_indexing_buffer should be the human readable version (e.g. 51.1mb). This is currently swapped and is against the patterns set out by other human byte count properties.

This discrepancy was introduced >8 years ago: ebc3c17#diff-0f31418774699d0487aba335ddccd8942599b4a9999e92e2932bcfb6a22aa392
The two explicit fields were merged to use on of the "human readable field" XContentBuilder methods to enable use of the ?human parameter, however the parameters to byteSizeField were swapped.

Related component

Cluster Manager

To Reproduce

  1. Execute GET /_nodes?human&filter_path=nodes.*.total_indexing_buffer*
  2. See the response:
{
  "nodes": {
    "741KuezCTUaGy0RDV7oxEA": {
      "total_indexing_buffer_in_bytes": "51.1mb",
      "total_indexing_buffer": 53687091
    },
    "eTLqEyRiQzaxSYdZ1KbfVA": {
      "total_indexing_buffer_in_bytes": "51.1mb",
      "total_indexing_buffer": 53687091
    }
  }
}

Expected behavior

The total_indexing_buffer_in_bytes field should contain the raw byte count and the total_indexing_buffer field should contain the human readable version.

Additional Details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Cluster ManagerbugSomething isn't workingv3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions