-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Fix trappy timeouts in GetAliasesRequest
#119817
Conversation
Removes the use of the trappy default master node timeout and configures a sensible default instead.
Pinging @elastic/es-data-management (Team:Data Management) |
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.
I added comments to non-test files to justify my timeout choices.
@@ -748,7 +748,7 @@ private void validateIndexBeforePromotion(String destinationIndexName, ClusterSt | |||
private void updateEnrichPolicyAlias(ActionListener<IndicesAliasesResponse> listener) { | |||
String enrichIndexBase = EnrichPolicy.getBaseName(policyName); | |||
logger.debug("Policy [{}]: Promoting new enrich index [{}] to alias [{}]", policyName, enrichIndexName, enrichIndexBase); | |||
GetAliasesRequest aliasRequest = new GetAliasesRequest(enrichIndexBase); | |||
GetAliasesRequest aliasRequest = new GetAliasesRequest(ENRICH_MASTER_REQUEST_TIMEOUT, enrichIndexBase); |
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.
This existing timeout field felt more sensible than an infinite timeout.
@@ -221,8 +221,9 @@ private void makeMlInternalIndicesHidden() { | |||
logger.warn("One or more of the ML internal indices could not be made hidden."); | |||
return; | |||
} | |||
GetAliasesRequest getAliasesRequest = new GetAliasesRequest().indices(mlHiddenIndexPatterns) | |||
.indicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED_HIDDEN); | |||
GetAliasesRequest getAliasesRequest = new GetAliasesRequest(MasterNodeRequest.INFINITE_MASTER_NODE_TIMEOUT).indices( |
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.
Specified an infinite timeout here as this is an internal request - as per #107984.
@@ -475,8 +476,10 @@ private void deleteAliases(@SuppressWarnings("HiddenField") String jobId, Action | |||
final String writeAliasName = AnomalyDetectorsIndex.resultsWriteAlias(jobId); | |||
|
|||
// first find the concrete indices associated with the aliases | |||
GetAliasesRequest aliasesRequest = new GetAliasesRequest().aliases(readAliasName, writeAliasName) | |||
.indicesOptions(IndicesOptions.lenientExpandOpenHidden()); | |||
GetAliasesRequest aliasesRequest = new GetAliasesRequest(MasterNodeRequest.INFINITE_MASTER_NODE_TIMEOUT).aliases( |
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.
Same here regarding infinite timeout.
@@ -694,7 +695,7 @@ public void resolveAsSeparateMappings( | |||
} | |||
|
|||
private static GetAliasesRequest createGetAliasesRequest(FieldCapabilitiesResponse response, boolean includeFrozen) { | |||
return new GetAliasesRequest().aliases("*") | |||
return new GetAliasesRequest(MasterNodeRequest.INFINITE_MASTER_NODE_TIMEOUT).aliases("*") |
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.
This method is only used by the sql
x-pack plugin, which I interpreted as internal use as well.
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.
LGTM
💔 Backport failed
You can use sqren/backport to manually backport by running |
Removes the use of the trappy default master node timeout and configures a sensible default instead.
Relates #107984