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

Support cross clusters query in ESQL #101640

Merged
merged 21 commits into from Dec 28, 2023
Merged

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Oct 31, 2023

This pull request introduces support for cross-clusters query (CCQ) in ESQL. The enrich in CCQ will be implemented in a separate pull request due to its complex semantic nature. The primary change occurs in the ComputeService class, where a cluster-compute-action is introduced.

The implementation in this PR is equivalent to CCS with ccs_minimize_round_trips enabled. Currently, our plan is to support a single mode in CCQ. At present, the coordinator on the remote cluster collects pages from data nodes in the same cluster and provides them to the coordinator of the main cluster. This is achieved using two exchange buffers, although a single exchange buffer could suffice. However, the use of two buffers allows for future execution of a plan on this coordinator to perform partial reduce operations, such as limit, topN, and partial-to-partial aggregation.

Security and backward compatibility tests have been added in the multi-cluster-search-security and multi-clusters QA modules, respectively.

@dnhatn dnhatn added the WIP label Oct 31, 2023
@dnhatn dnhatn added the :Analytics/ES|QL AKA ESQL label Oct 31, 2023
@nik9000 nik9000 self-requested a review November 3, 2023 11:52
@costin costin mentioned this pull request Nov 16, 2023
10 tasks
@costin
Copy link
Member

costin commented Dec 5, 2023

Relates #102954

@dnhatn dnhatn force-pushed the cross-clusters-esql branch 4 times, most recently from f06d647 to bf0a972 Compare December 15, 2023 06:42
@dnhatn dnhatn force-pushed the cross-clusters-esql branch 3 times, most recently from 64b78ed to 00f6d92 Compare December 16, 2023 05:04
@dnhatn
Copy link
Member Author

dnhatn commented Dec 18, 2023

@ChrisHegarty, I'm adding you as the reviewer since the new cluster-compute-action is similar to the data-node-compute action, which you are familiar with.

@elasticsearchmachine
Copy link
Collaborator

Hi @dnhatn, I've created a changelog YAML for you.

@dnhatn dnhatn marked this pull request as ready for review December 18, 2023 06:38
@elasticsearchmachine elasticsearchmachine added the Team:QL (Deprecated) Meta label for query languages team label Dec 18, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL)

@dnhatn
Copy link
Member Author

dnhatn commented Dec 26, 2023

@mark-vieira Thanks for looking. I've switched to the new test framework. I think the new test framework doesn't support multi-clusters with different versions. I work around this limitation by starting two clusters with the old version, then performing a full cluster restart once before running tests.

@dnhatn
Copy link
Member Author

dnhatn commented Dec 26, 2023

@nik9000 I've addressed your comments. Can you take another look please? Thank you!

@dnhatn dnhatn requested a review from nik9000 December 26, 2023 18:17
@mark-vieira
Copy link
Contributor

I work around this limitation by starting two clusters with the old version, then performing a full cluster restart once before running tests.

This shouldn't be necessary. Can you elaborate on what issue you encountered when you attempted to configure one cluster using the BWC version and the other using the current version?

@dnhatn
Copy link
Member Author

dnhatn commented Dec 26, 2023

@mark-vieira I checked the nodes of both clusters, they work properly without the workaround. I have removed the workaround in e19bf39. We should be all good here. Thanks Mark.

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to merge when @mark-vieira is happy.

@dnhatn
Copy link
Member Author

dnhatn commented Dec 27, 2023

@mark-vieira I think I have addressed your comments. Can you please take another look? Thank you!

@dnhatn
Copy link
Member Author

dnhatn commented Dec 28, 2023

@nik9000 @mark-vieira Thank you for the reviews.

@dnhatn dnhatn merged commit b8b025c into elastic:main Dec 28, 2023
15 checks passed
@dnhatn dnhatn deleted the cross-clusters-esql branch December 28, 2023 01:29
jbaiera pushed a commit to jbaiera/elasticsearch that referenced this pull request Jan 10, 2024
This pull request introduces support for cross-clusters query (CCQ) in 
ESQL. The enrich in CCQ will be implemented in a separate pull request
due to its complex semantic nature. The primary change occurs in the
ComputeService class, where a cluster-compute-action is introduced.

The implementation in this PR is equivalent to CCS with 
ccs_minimize_round_trips enabled. Currently, our plan is to support a
single mode in CCQ. At present, the coordinator on the remote cluster 
collects pages from data nodes in the same cluster and provides them to
the coordinator of the main cluster. This is achieved using two exchange
buffers, although a single exchange buffer could suffice. However, the
use of two buffers allows for future execution of a plan on this
coordinator to perform partial reduce operations, such as limit, topN,
and partial-to-partial aggregation.

Security and backward compatibility tests have been added in the 
multi-cluster-search-security and multi-clusters QA modules,
respectively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:QL (Deprecated) Meta label for query languages team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants