Skip to content

Commit

Permalink
Fix NPE for /_cat/indices when no primary shard (elastic#26953)
Browse files Browse the repository at this point in the history
When a node which contains the primary shard is unavailable, the primary
stats (and the total stats) of an `IndexStats` will be empty for a short
moment (while the primary shard is being relocated). However, we assume
that these stats are always non-empty when handling `_cat/indices` in
RestIndicesAction. This commit checks the content of these stats before
accessing.

Closes elastic#26942
  • Loading branch information
dnhatn authored and Rahul Anishetty committed Mar 9, 2018
1 parent 1247377 commit d860bd3
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 119 deletions.
Loading

0 comments on commit d860bd3

Please sign in to comment.