Skip to content

[BUG] The /{index}/_recovery API returns responses in a non-standard format(using camelCase). #16334

@hogesako

Description

@hogesako

Describe the bug

The /{index}/_recovery API returns the following response.
The field names isSearchableSnapshot, remoteStoreIndexShallowCopy, sourceRemoteStoreRepository and sourceRemoteTranslogRepository are in non-standard format(using camelCase).

{
  "test_index": {
    "shards": [
      {
        "id": 0,
        "type": "SNAPSHOT",
        "stage": "DONE",
        "primary": true,
        "start_time_in_millis": 1728835477686,
        "stop_time_in_millis": 1728835477725,
        "total_time_in_millis": 39,
        "source": {
          "repository": "test-repository",
          "snapshot": "6",
          "version": "2.17.0",
          "index": "test_index",
          "restoreUUID": "n7wQKoo_RpiFVXJB5BuKDQ",
          "isSearchableSnapshot": false,
          "remoteStoreIndexShallowCopy": false,
          "sourceRemoteStoreRepository": null,
          "sourceRemoteTranslogRepository": null
        },
        "target": {
          "id": "UtghWlpCT3akPM5wbVJxXA",
          "host": "172.19.0.2",
          "transport_address": "172.19.0.2:9300",
          "ip": "172.19.0.2",
          "name": "jdk21"
        },
        "index": {
          "size": {
            "total_in_bytes": 208,
            "reused_in_bytes": 0,
            "recovered_in_bytes": 208,
            "percent": "100.0%"
          },
          "files": {
            "total": 1,
            "reused": 0,
            "recovered": 1,
            "percent": "100.0%"
          },
          "total_time_in_millis": 23,
          "source_throttle_time_in_millis": 0,
          "target_throttle_time_in_millis": 0
        },
        "translog": {
          "recovered": 0,
          "total": 0,
          "percent": "100.0%",
          "total_on_start": 0,
          "total_time_in_millis": 7
        },
        "verify_index": {
          "check_index_time_in_millis": 0,
          "total_time_in_millis": 0
        }
      }
    ]
  }
}

Source code is also implemented in CamelCase.
https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java#L413-L421

Related component

Other

To Reproduce

  1. Restore snapshot.
  2. Access /{index}/_recovery API.

Expected behavior

API must be returned in standard format.

Additional Details

Plugins
None

Screenshots
None

Host/Environment (please complete the following information):

  • OpenSearch 2.17.0 on docker

Additional context
opensearch-project/opensearch-api-specification#611 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions