Skip to content

[CCR] The stats for an unknown index return a 200 status #37021

@sebelga

Description

@sebelga

When we try to access the stats for a follower index that does not exist, we receive a 200 status with the following response

GET /unknown/_ccr/stats

Status 200
{
    "indices": []
}

To be consistent with other APIs and follow REST standards, it should return a 404 status.

If we try the same with the /_stats API we do get the correct status

GET /unknown/_stats

Response
{
    "error": {
        "root_cause": [
            {
                "type": "index_not_found_exception",
                "reason": "no such index [unknown]",
                "resource.type": "index_or_alias",
                "resource.id": "unknown",
                "index_uuid": "_na_",
                "index": "unknown"
            }
        ],
        "type": "index_not_found_exception",
        "reason": "no such index [unknown]",
        "resource.type": "index_or_alias",
        "resource.id": "unknown",
        "index_uuid": "_na_",
        "index": "unknown"
    },
    "status": 404
}

Metadata

Metadata

Assignees

Labels

:Distributed/CCRIssues around the Cross Cluster State Replication features>bug

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