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
This commit is contained in:
Britta Weber 2015-09-01 12:15:28 +02:00
parent 7caed74d5d
commit 05b48b904d
3 changed files with 4 additions and 2 deletions

View File

@ -53,7 +53,7 @@ public class TransportFlushAction extends TransportBroadcastReplicationAction<Fl
@Override
protected ShardFlushRequest newShardRequest(FlushRequest request, ShardId shardId) {
return new ShardFlushRequest(request).setShardId(shardId).timeout("0ms");
return new ShardFlushRequest(request).setShardId(shardId);
}
@Override

View File

@ -54,7 +54,7 @@ public class TransportRefreshAction extends TransportBroadcastReplicationAction<
@Override
protected ReplicationRequest newShardRequest(RefreshRequest request, ShardId shardId) {
return new ReplicationRequest(request).setShardId(shardId).timeout("0ms");
return new ReplicationRequest(request).setShardId(shardId);
}
@Override

View File

@ -228,6 +228,7 @@ public class BroadcastReplicationTests extends ESTestCase {
}
@Test
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/13238")
public void testTimeoutFlush() throws ExecutionException, InterruptedException {
final String index = "test";
@ -269,6 +270,7 @@ public class BroadcastReplicationTests extends ESTestCase {
}
@Test
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/13238")
public void testTimeoutRefresh() throws ExecutionException, InterruptedException {
final String index = "test";