diff --git a/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java b/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java index c48b876258f..28976f12f3d 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java @@ -112,7 +112,7 @@ public class TransportRefreshAction extends TransportBroadcastOperationAction entry : versionMap.entrySet()) { HashedBytesRef uid = entry.getKey(); synchronized (dirtyLock(uid.bytes)) { // can we do it without this lock on each value? maybe batch to a set and get the lock once per set? diff --git a/src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayService.java b/src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayService.java index e8eaaa00396..f45d7afdfae 100644 --- a/src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayService.java +++ b/src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayService.java @@ -183,7 +183,7 @@ public class IndexShardGatewayService extends AbstractIndexShardComponent implem indexShard.start("post recovery from gateway"); } // refresh the shard - indexShard.refresh(new Engine.Refresh().force(true)); + indexShard.refresh(new Engine.Refresh().force(true).source("post_gateway")); recoveryStatus.time(System.currentTimeMillis() - recoveryStatus.startTime()); recoveryStatus.updateStage(RecoveryStatus.Stage.DONE); diff --git a/src/main/java/org/elasticsearch/index/percolator/PercolatorQueriesRegistry.java b/src/main/java/org/elasticsearch/index/percolator/PercolatorQueriesRegistry.java index c9e5e9fb83c..caeae18f9c4 100644 --- a/src/main/java/org/elasticsearch/index/percolator/PercolatorQueriesRegistry.java +++ b/src/main/java/org/elasticsearch/index/percolator/PercolatorQueriesRegistry.java @@ -226,7 +226,7 @@ public class PercolatorQueriesRegistry extends AbstractIndexShardComponent { private void loadQueries(IndexShard shard) { try { - shard.refresh(new Engine.Refresh().force(true)); + shard.refresh(new Engine.Refresh().force(true).source("percolator_load_queries")); Engine.Searcher searcher = shard.acquireSearcher(); try { Query query = new XConstantScoreQuery( diff --git a/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java b/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java index de1ad3efa5c..ce999056424 100644 --- a/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java +++ b/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java @@ -256,7 +256,7 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I // make sure we refresh on state change due to cluster state changes if (newRouting.state() == ShardRoutingState.STARTED && (currentRouting == null || currentRouting.state() != ShardRoutingState.STARTED)) { try { - engine.refresh(new Engine.Refresh().force(true)); + engine.refresh(new Engine.Refresh().force(true).source("cluster_state_started")); } catch (Throwable t) { logger.debug("failed to refresh due to move to cluster wide started", t); } @@ -655,7 +655,7 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I } // clear unreferenced files translog.clearUnreferenced(); - engine.refresh(new Engine.Refresh().force(true)); + engine.refresh(new Engine.Refresh().force(true).source("recovery_finalization")); synchronized (mutex) { logger.debug("state: [{}]->[{}], reason [post recovery]", state, IndexShardState.STARTED); state = IndexShardState.STARTED; @@ -825,7 +825,7 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I public void run() { try { if (engine.refreshNeeded()) { - refresh(new Engine.Refresh().force(false)); + refresh(new Engine.Refresh().force(false).source("scheduled")); } } catch (EngineClosedException e) { // we are being closed, ignore