Skip to content

Order of atomic alias operations seems inconsistent #27689

@mayya-sharipova

Description

@mayya-sharipova

Executing an atomic alias operations on the same index and same alias returns inconsistent results:

# 1) Put an index
PUT some-concrete-index

# 2) no alias exists yet
GET some-concrete-index/_alias

# 3) add an alias, then remove it
POST /_aliases
{
  "actions": [
    {
      "add": {
        "index": "some-concrete-index",
        "alias": "oci-cmdb_service_members"
      }
    },
    {
      "remove": {
        "index": "some-concrete-index",
        "alias": "oci-cmdb_service_members"
      }
    }
  ]
}

# 4) Order shouldn't matter, and it does not seem to, as the alias now exists
GET some-concrete-index/_alias

#5) Execute the same operation again:
POST /_aliases
{
  "actions": [
    {
      "add": {
        "index": "some-concrete-index",
        "alias": "oci-cmdb_service_members"
      }
    },
    {
      "remove": {
        "index": "some-concrete-index",
        "alias": "oci-cmdb_service_members"
      }
    }
  ]
}

#6) The alias is removed now
GET some-concrete-index/_alias

To sum up:
The same request will produce different result:

  1. If the alias doesn’t exist before the request, it will be created
  2. If the alias doest exists, it will be removed

Metadata

Metadata

Labels

:Data Management/Indices APIsDO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead.>bughelp wantedadoptme

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions