浏览代码

InternalEngine - back to set dirty=false just *before* a refresh is done

reverting: 5553c383bca1f8b5437aa0eb34e291824e9057fb
Boaz Leskes 11 年之前
父节点
当前提交
62b850f52d
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java

+ 4 - 1
src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java

@@ -706,9 +706,12 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin
                 // but, we want to make sure not to loose ant refresh calls, if one is taking time
                 synchronized (refreshMutex) {
                     if (dirty || refresh.force()) {
+                        // we set dirty to false, even though the refresh hasn't happened yet
+                        // as the refresh only holds for data indexed before it. Any data indexed during
+                        // the refresh will not be part of it and will set the dirty flag back to true
+                        dirty = false;
                         boolean refreshed = searcherManager.maybeRefresh();
                         assert refreshed : "failed to refresh even though refreshMutex was acquired";
-                        dirty = false;
                     }
                 }
             } catch (AlreadyClosedException e) {