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
Conversation
@@ -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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 58fb561c45f4fd9446895adb5f82bdffb26f3cc9.
Left some comments. |
ShardRoutingEntry shardRoutingEntry = new ShardRoutingEntry(shardRouting, indexUUID, message, failure); | ||
TransportRequestOptions options = TransportRequestOptions.options(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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
Add timeout mechanism for sending shard failures
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