only flush when the index shard is in STARTED mode (nothing will break flushing on non started index, just remove a possible warn logging)

This commit is contained in:
kimchy 2011-03-01 00:26:03 +02:00
parent 0662f65fda
commit 9d81d01c93
1 changed files with 3 additions and 1 deletions

View File

@ -116,7 +116,9 @@ public class TranslogService extends AbstractIndexShardComponent {
threadPool.executor(ThreadPool.Names.MANAGEMENT).execute(new Runnable() { threadPool.executor(ThreadPool.Names.MANAGEMENT).execute(new Runnable() {
@Override public void run() { @Override public void run() {
try { try {
indexShard.flush(new Engine.Flush()); if (indexShard.state() == IndexShardState.STARTED) {
indexShard.flush(new Engine.Flush());
}
} catch (EngineClosedException e) { } catch (EngineClosedException e) {
// we are being closed, ignore // we are being closed, ignore
} catch (FlushNotAllowedEngineException e) { } catch (FlushNotAllowedEngineException e) {