-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Allow QueryRewriteContext to perform async actions on remote clusters #138124
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
Allow QueryRewriteContext to perform async actions on remote clusters #138124
Conversation
|
Pinging @elastic/search-relevance (Team:Search - Relevance) |
server/src/main/java/org/elasticsearch/index/query/QueryRewriteContext.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/query/QueryRewriteContext.java
Outdated
Show resolved
Hide resolved
kderusso
left a comment
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.
Changes look reasonable to me, are there tests we can add here?
|
@kderusso Tests were added in |
|
@Mikep86 Sorry for the confusion, were there any additional unit tests that could make sense. |
|
@kderusso Unit tests for |
|
That's fair, I wanted to make sure we're thinking of it. Will defer to other reviewers for other concerns. |
|
Moving this back into draft as I work on modifying the implementation and test to handle security |
|
@elasticmachine update branch |
|
@elasticmachine update branch |
|
Hey all, this is ready for review again. I made changes to
|
| private void deleteSecurityIndex(String clusterAlias) { | ||
| final Client client = new OriginSettingClient(client(clusterAlias), SECURITY_ORIGIN); | ||
|
|
||
| GetIndexRequest getIndexRequest = new GetIndexRequest(TEST_REQUEST_TIMEOUT); | ||
| getIndexRequest.indices(SECURITY_MAIN_ALIAS); | ||
| getIndexRequest.indicesOptions(IndicesOptions.lenientExpandOpen()); | ||
| GetIndexResponse getIndexResponse = client.admin().indices().getIndex(getIndexRequest).actionGet(TEST_REQUEST_TIMEOUT); | ||
|
|
||
| if (getIndexResponse.getIndices().length > 0) { | ||
| DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(getIndexResponse.getIndices()); | ||
| assertAcked(client.admin().indices().delete(deleteIndexRequest).actionGet(TEST_REQUEST_TIMEOUT)); | ||
| } | ||
| } |
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.
kderusso
left a comment
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.
Changes LGTM, as long as we have sufficient owner reviewers as well
server/src/main/java/org/elasticsearch/index/query/QueryRewriteContext.java
Outdated
Show resolved
Hide resolved
jimczi
left a comment
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
Adds methods to
QueryRewriteContextfor registering and executing remote cluster async actions as part of the query rewrite process.This functionality will be used by the
semanticand intercepted (match/sparse_vector/knn) queries to get remote cluster inference results when performing CCS withccs_minimize_roundtrips=false. It will also be used by the simplifiedlinear/rrfretrievers to handle CCS. See the semantic search CCS POC for more context.Both of these use cases will be implemented in follow-up PRs.