Skip to content

Conversation

@dnhatn
Copy link
Member

@dnhatn dnhatn commented May 5, 2023

This PR integrates CCS with the new search_shards API. With this change, we will be able to skip shards on the coordinator on remote clusters using the timestamps stored in the cluster state.

Relates #94534
Closes #93730

@dnhatn dnhatn force-pushed the ccs-can-match branch 10 times, most recently from 7db7d36 to 34bf797 Compare May 7, 2023 01:22
@dnhatn dnhatn added the test-full-bwc Trigger full BWC version matrix tests label May 7, 2023
@dnhatn dnhatn removed the test-full-bwc Trigger full BWC version matrix tests label May 8, 2023
@dnhatn dnhatn force-pushed the ccs-can-match branch 6 times, most recently from faec02c to a77a3f7 Compare May 9, 2023 22:37
@dnhatn dnhatn added the test-full-bwc Trigger full BWC version matrix tests label May 9, 2023
@dnhatn dnhatn force-pushed the ccs-can-match branch 3 times, most recently from 66551cd to f817652 Compare May 9, 2023 23:08
@dnhatn dnhatn changed the title WIP - Integrate CCS with new search_shards API Integrate CCS with new search_shards API May 9, 2023
@dnhatn dnhatn added :Search/Search Search-related issues that do not fall into other categories >enhancement labels May 9, 2023
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@quux00 quux00 left a comment

Choose a reason for hiding this comment

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

LGTM. Really nice work here @dnhatn ! Thanks for the help going through the changes with me.

@dnhatn
Copy link
Member Author

dnhatn commented May 13, 2023

@quux00 Thanks for reviews.

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @dnhatn , I left some comments and questions.

* will invoke the listener immediately.
*/
void ensureConnected(String clusterAlias, ActionListener<Void> listener) {
public void ensureConnected(String clusterAlias, ActionListener<Void> listener) {
Copy link
Member

Choose a reason for hiding this comment

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

I am not entirely sure that this is a good idea, I tend to think that this is not public for a good reason, in that consumers should not worry about handling connection.

Copy link
Member Author

Choose a reason for hiding this comment

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

I made an alternative to combine both ensureConnected and getConnection in 56571d8. WDYT? Here we need to replicate partially the logic in RemoteClusterAwareClient#doExecute. Any suggestion are welcome.

Copy link
Member

Choose a reason for hiding this comment

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

I see thanks for trying that. I think that I am still missing why we can't use the remote cluster client like we did before, sorry if that's a silly question but it's not so obvious to me :)

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason that we can't use the remote cluster client is that we need to know the version the of the transport connection (between the local and remote clusters) before we decide if we can go with the new action.

@dnhatn
Copy link
Member Author

dnhatn commented May 16, 2023

@javanna Thanks for reviews. I think I have addressed all your comments except the preFiltered flag. Can you take another look?

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

still a couple of questions but no blockers.

* will invoke the listener immediately.
*/
void ensureConnected(String clusterAlias, ActionListener<Void> listener) {
public void ensureConnected(String clusterAlias, ActionListener<Void> listener) {
Copy link
Member

Choose a reason for hiding this comment

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

I see thanks for trying that. I think that I am still missing why we can't use the remote cluster client like we did before, sorry if that's a silly question but it's not so obvious to me :)

@dnhatn
Copy link
Member Author

dnhatn commented May 17, 2023

@quux00 @javanna Thank you so much for the reviews. I am planning to merge this PR today. If you have any feedback, please feel free to comment. I will address them either in this PR or in a follow-up.

@dnhatn dnhatn merged commit 7da55d0 into elastic:main May 17, 2023
@dnhatn dnhatn deleted the ccs-can-match branch May 17, 2023 18:36
dnhatn added a commit that referenced this pull request Jun 1, 2023
When security is enabled, CCS requests for a remote wildcard pointing data streams are not resolved correctly. This issue happens because search_shards requests do not override the includeDataStreams method, causing the RBAC engine to exclude data streams while resolving the index pattern. Relates #95894 Relates #94534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.9.0

4 participants