Add additional logging for #43034

It's unclear why sometimes the shard is not flushed on closing
This commit is contained in:
Yannick Welsch 2019-06-24 12:28:59 +02:00
parent 127a608147
commit 19520d4640
2 changed files with 4 additions and 0 deletions

View File

@ -472,6 +472,8 @@ public class IndexService extends AbstractIndexComponent implements IndicesClust
try {
// only flush we are we closed (closed index or shutdown) and if we are not deleted
final boolean flushEngine = deleted.get() == false && closed.get();
logger.trace("[{}] closing shard (flushEngine: {}, deleted: {}, closed: {})", shardId, flushEngine, deleted.get(),
closed.get());
indexShard.close(reason, flushEngine);
} catch (Exception e) {
logger.debug(() -> new ParameterizedMessage("[{}] failed to close index shard", shardId), e);

View File

@ -1716,6 +1716,8 @@ public abstract class Engine implements Closeable {
close(); // double close is not a problem
}
}
} else {
logger.trace("skipping flushAndClose as already closed");
}
awaitPendingClose();
}