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

Fix trappy timeouts in GetAliasesRequest #119817

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

nielsbauman
Copy link
Contributor

Removes the use of the trappy default master node timeout and configures a sensible default instead.

Relates #107984

Removes the use of the trappy default master node timeout and configures
a sensible default instead.
@nielsbauman nielsbauman added :Data Management/Indices APIs APIs to create and manage indices and templates >refactoring Team:Data Management Meta label for data/management team auto-backport Automatically create backport pull requests when merged v9.0.0 v8.18.0 labels Jan 9, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Copy link
Contributor Author

@nielsbauman nielsbauman left a 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);
Copy link
Contributor Author

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(
Copy link
Contributor Author

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(
Copy link
Contributor Author

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("*")
Copy link
Contributor Author

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.

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM

@nielsbauman nielsbauman merged commit 48b9fae into elastic:main Jan 9, 2025
16 checks passed
@nielsbauman nielsbauman deleted the timeout-alias branch January 9, 2025 22:59
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 119817

@nielsbauman nielsbauman removed backport pending v8.18.0 auto-backport Automatically create backport pull requests when merged labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >refactoring Team:Data Management Meta label for data/management team v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants