Fix NPE on Stale Index in IndicesService(#39173)

This is a backport of  #38891 which closes #38845
This commit is contained in:
Ioannis Kakavas 2019-02-20 15:35:35 +02:00 committed by GitHub
parent 09ea3ccd16
commit c783069804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -900,6 +900,9 @@ public class IndicesService extends AbstractLifecycleComponent
final IndexMetaData metaData;
try {
metaData = metaStateService.loadIndexState(index);
if (metaData == null) {
return null;
}
} catch (Exception e) {
logger.warn(() -> new ParameterizedMessage("[{}] failed to load state file from a stale deleted index, " +
"folders will be left on disk", index), e);