From 05b48b904d55a237d69db3de28c7069cab901a7b Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Tue, 1 Sep 2015 12:15:28 +0200 Subject: [PATCH] set timeout for refresh and flush to default Since #13068 refresh and flush requests go to the primary first and are then replicated. One difference to before is though that if a shard is not available (INITIALIZING for example) we wait a little for an indexing request but for refresh we don't and just give up immediately. Before, refresh requests were just send to the shards regardless of what their state is. In tests we sometimes create an index, issue an indexing request, refresh and then get the document. But we do not wait until all nodes know that all primaries have ben assigned. Now potentially one node can be one cluster state behind and not know yet that the shards have ben started. If the refresh is executed through this node then the refresh request will silently fail on shards that are started already because from the nodes perspective they are still initializing. As a consequence, documents that expected to be available in the test are now not. Example test failures are here: http://build-us-00.elastic.co/job/elasticsearch-20-oracle-jdk7/395/ This commit changes the timeout to 1m (default) to make sure we don't miss shards when we refresh. This will trigger the same retry mechanism as for indexing requests. We still have to make a decision if this change of behavior is acceptable. see #13238 --- .../action/admin/indices/flush/TransportFlushAction.java | 2 +- .../action/admin/indices/refresh/TransportRefreshAction.java | 2 +- .../action/support/replication/BroadcastReplicationTests.java | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java b/core/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java index d43cbb25ab5..2882b508a81 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java +++ b/core/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java @@ -53,7 +53,7 @@ public class TransportFlushAction extends TransportBroadcastReplicationAction