Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some index stats are reset when the index is moved to another node #77990

Open
fdartayre opened this issue Sep 20, 2021 · 1 comment
Open

Some index stats are reset when the index is moved to another node #77990

fdartayre opened this issue Sep 20, 2021 · 1 comment
Labels
>bug :Data Management/Stats Statistics tracking and retrieval APIs Team:Data Management Meta label for data/management team

Comments

@fdartayre
Copy link
Contributor

Elasticsearch version (bin/elasticsearch --version): 7.14.1

Description of the problem including expected versus actual behavior:
The search and indexing metrics from index stats are reset when the index is moved to another node. This is unintuitive and can easily be misleading.

Steps to reproduce:

  1. Create an index with 4 documents
PUT my_index
{
  "settings": { 
    "number_of_replicas": 1
  }
}

POST my_index/_bulk
{ "index": { "_id": 1 }}
{}
{ "index": { "_id": 2 }}
{}
{ "index": { "_id": 3 }}
{}
{ "index": { "_id": 4 }}
{}
  1. The indexing count is incremented accordingly
GET _stats?filter_path=indices.my_index.*.indexing.index_total

{
  "indices" : {
    "my_index" : {
      "primaries" : {
        "indexing" : {
          "index_total" : 4
        }
      },
      "total" : {
        "indexing" : {
          "index_total" : 8
        }
      }
    }
  }
}
  1. Move the primary to another node
GET _cat/shards/my_index?v

index    shard prirep state   docs store ip         node
my_index 0     p      STARTED    4 2.9kb 172.21.0.2 es3
my_index 0     r      STARTED    4 2.9kb 172.21.0.3 es1
POST /_cluster/reroute
{
  "commands": [
    {
      "move": {
        "index": "my_index", "shard": 0,
        "from_node": "es3", "to_node": "es2"
      }
    }
  ]
}
  1. The indexing stats are reset for the primary shard
GET _stats?filter_path=indices.my_index.*.indexing.index_total

{
  "indices" : {
    "my_index" : {
      "primaries" : {
        "indexing" : {
          "index_total" : 0
        }
      },
      "total" : {
        "indexing" : {
          "index_total" : 4
        }
      }
    }
  }
}
@fdartayre fdartayre added >bug :Data Management/Stats Statistics tracking and retrieval APIs needs:triage Requires assignment of a team area label labels Sep 20, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Sep 20, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@pugnascotia pugnascotia removed the needs:triage Requires assignment of a team area label label Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Stats Statistics tracking and retrieval APIs Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

3 participants