also flush before optimize, just to optimize all the changes up until now

This commit is contained in:
Shay Banon 2011-08-12 13:01:11 +03:00
parent 8a69910465
commit 016bcdfa3a
1 changed files with 3 additions and 0 deletions

View File

@ -913,6 +913,9 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine {
}
@Override public void optimize(Optimize optimize) throws EngineException {
if (optimize.flush()) {
flush(new Flush());
}
if (optimizeMutex.compareAndSet(false, true)) {
rwl.readLock().lock();
try {