Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout mechanism for sending shard failures #14707

Merged
merged 1 commit into from Nov 17, 2015
Merged

Add timeout mechanism for sending shard failures #14707

merged 1 commit into from Nov 17, 2015

Conversation

jasontedor
Copy link
Member

This commit adds a timeout mechanism for sending shard failures. The
requesting thread can attach a listener to the timeout event so that
handling it is part of the event chain.

Relates #14252

@@ -578,7 +580,9 @@ void performOnPrimary(final ShardRouting primary, final ShardIterator shardsIt)
PrimaryOperationRequest por = new PrimaryOperationRequest(primary.id(), internalRequest.concreteIndex(), internalRequest.request());
Tuple<Response, ReplicaRequest> primaryResponse = shardOperationOnPrimary(observer.observedState(), por);
logger.trace("operation completed on primary [{}]", primary);
replicationPhase = new ReplicationPhase(shardsIt, primaryResponse.v2(), primaryResponse.v1(), observer, primary, internalRequest, listener, indexShardReference);
// TODO: set a default timeout
TimeValue shardFailedTimeout = settings.getAsTime(REPLICATION_ACTION_SHARD_FAILURE_TIMEOUT, null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in generation, this should be a variable that's resolved and cached. We shouldn't do settings lookups with each op.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 58fb561c45f4fd9446895adb5f82bdffb26f3cc9.

@bleskes
Copy link
Contributor

bleskes commented Nov 13, 2015

Left some comments.

ShardRoutingEntry shardRoutingEntry = new ShardRoutingEntry(shardRouting, indexUUID, message, failure);
TransportRequestOptions options = TransportRequestOptions.options();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - why not initialize the options to EMPTY and only create a new object under the if?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Changed in d1dd9d2d2a1e18afe4454c7adaa18098f55c9e1b.

@bleskes
Copy link
Contributor

bleskes commented Nov 13, 2015

LGTM

This commit adds a timeout mechanism for sending shard failures. The
requesting thread can attach a listener to the timeout event so that
handling it is part of the event chain.

Relates #14252
@jasontedor jasontedor removed the review label Nov 17, 2015
jasontedor added a commit that referenced this pull request Nov 17, 2015
Add timeout mechanism for sending shard failures
@jasontedor jasontedor merged commit 4f3eec9 into elastic:master Nov 17, 2015
@jasontedor jasontedor deleted the shard-failure-timeout branch November 17, 2015 21:42
@jasontedor jasontedor mentioned this pull request Nov 24, 2015
9 tasks
@clintongormley clintongormley added :Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. and removed :Cluster labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Distributed A catch all label for anything in the Distributed Area. If you aren't sure, use this one. >enhancement resiliency v5.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants