From 62b850f52df3d99b6fb704f3b0463d5aa28bfa09 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Mon, 31 Mar 2014 20:57:58 +0200 Subject: [PATCH] InternalEngine - back to set dirty=false just *before* a refresh is done reverting: 5553c383bca1f8b5437aa0eb34e291824e9057fb --- .../elasticsearch/index/engine/internal/InternalEngine.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java b/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java index c7b14038f45..8e5df9e5403 100644 --- a/src/main/java/org/elasticsearch/index/engine/internal/InternalEngine.java +++ b/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) {