Fire off another maybeFlush on finish to ensure we don't miss a pending flush

This commit is contained in:
Simon Willnauer 2015-09-24 09:28:14 +02:00
parent 1fd8c64f1f
commit 6cbf2de592
2 changed files with 1 additions and 2 deletions

View File

@ -1521,6 +1521,7 @@ public class IndexShard extends AbstractIndexShardComponent {
@Override
public void onAfter() {
asyncFlushRunning.compareAndSet(true, false);
maybeFlush(); // fire a flush up again if we have filled up the limits such that shouldFlush() returns true
}
};
threadPool.executor(ThreadPool.Names.FLUSH).execute(abstractRunnable);
@ -1530,5 +1531,4 @@ public class IndexShard extends AbstractIndexShardComponent {
}
return false;
}
}

View File

@ -690,7 +690,6 @@ public class IndexShardTests extends ESSingleNodeTestCase {
assertTrue(postIndexWithExceptionCalled.get());
}
public void testMaybeFlush() throws Exception {
createIndex("test", settingsBuilder().put(TranslogConfig.INDEX_TRANSLOG_DURABILITY, Translog.Durabilty.REQUEST).build());
ensureGreen();