Skip to content

[BUG] Validation issue while adding/removing backing indices in aliases #14384

Closed
@raghuvanshraj

Description

@raghuvanshraj

Describe the bug

There is a bug in the PUT _alias/{alias} API that does not validate the fields inside the payload when adding/removing backing indices. While this results in a no-op, ideally an exception should be thrown and an incorrect payload should not be rejected.

Related component

Indexing

To Reproduce

  1. Create a new index
  2. Create an alias with this index as a backing index and supply an incorrect field inside the add block
  3. The service won't throw an error

Example:

PUT index-1
PUT _alias/alias-1
{
  "actions": [
    {
      "add": {
        "index": "index-1",
        "alias": "alias-1",
        "abcd": true
      }
    }
  ]
}

The response (unexpected) is the following:

{
  "acknowledged": true
}

Expected behavior

The service should throw an error in the above mentioned scenario as abcd is not a recognized field.

Additional Details

Plugins
NA

Screenshots
NA

Host/Environment (please complete the following information):
NA

Additional context
Sample attached above

Metadata

Metadata

Assignees

No one assigned

    Labels

    IndexingIndexing, Bulk Indexing and anything related to indexingbugSomething isn't workingv2.16.0Issues and PRs related to version 2.16.0v3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions