- Notifications
You must be signed in to change notification settings - Fork 25.6k
Integrate CCS with new search_shards API #95894
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
Conversation
7db7d36 to 34bf797 Compare faec02c to a77a3f7 Compare 66551cd to f817652 Compare | Hi @dnhatn, I've created a changelog YAML for you. |
server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CCSCanMatchIT.java Show resolved Hide resolved
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. Really nice work here @dnhatn ! Thanks for the help going through the changes with me.
server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java Outdated Show resolved Hide resolved
| @quux00 Thanks for reviews. |
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.
Thanks for working on this @dnhatn , I left some comments and questions.
server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CCSCanMatchIT.java Outdated Show resolved Hide resolved
server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CCSCanMatchIT.java Show resolved Hide resolved
server/src/internalClusterTest/java/org/elasticsearch/search/ccs/CCSCanMatchIT.java Outdated Show resolved Hide resolved
server/src/main/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhase.java Outdated Show resolved Hide resolved
server/src/main/java/org/elasticsearch/action/search/TransportSearchShardsAction.java Outdated Show resolved Hide resolved
| * will invoke the listener immediately. | ||
| */ | ||
| void ensureConnected(String clusterAlias, ActionListener<Void> listener) { | ||
| public void ensureConnected(String clusterAlias, ActionListener<Void> listener) { |
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 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.
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 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.
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 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 :)
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.
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.
server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java Show resolved Hide resolved
server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java Outdated Show resolved Hide resolved
server/src/main/java/org/elasticsearch/action/search/SearchShardsResponse.java Outdated Show resolved Hide resolved
server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java Show resolved Hide resolved
| @javanna Thanks for reviews. I think I have addressed all your comments except the |
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.
still a couple of questions but no blockers.
server/src/main/java/org/elasticsearch/action/search/SearchShardsResponse.java Outdated Show resolved Hide resolved
server/src/test/java/org/elasticsearch/transport/RemoteClusterConnectionTests.java Show resolved Hide resolved
| * will invoke the listener immediately. | ||
| */ | ||
| void ensureConnected(String clusterAlias, ActionListener<Void> listener) { | ||
| public void ensureConnected(String clusterAlias, ActionListener<Void> listener) { |
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 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 :)
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
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