-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 point in time cross cluster search #61827
Conversation
Pinging @elastic/es-search (:Search/Search) |
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
server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
Outdated
Show resolved
Hide resolved
@@ -72,6 +72,7 @@ protected void doExecute(Task task, OpenPointInTimeRequest request, ActionListen | |||
.preference(request.preference()) | |||
.routing(request.routing()) | |||
.allowPartialSearchResults(false); | |||
searchRequest.setCcsMinimizeRoundtrips(false); |
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.
Why is it needed ?
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.
We need to disable ccs_minimize_roundtrips because we don't know how to merge a point in time from multiple sub-search requests.
First of all, I have little knowlege about PIT's design and implementation. So my comments may be completely off. But in the spirit of learning, I am just going to ask it away :) To perform CCS with PIT, it requires the user to have
This behaviour is different from CCS with scroll or async_search, both of them do not require user to have any index privileges on the local cluster (as suggested by our docs), i.e. both following API calls work:
(Note ccs with scroll has an issue where it requires local privileges after the initial open scroll call. But we consider it as a bug #61828). Unless PIT's design is intentionally to be different on this front, consistency may be a better choice. Another thing I noticed is that if only remote indices are used for creating PIT, the initial creation will success (provide user has local index privileges). But the subsequent usage results in NEP, i.e:
// The above call results in error:
Ping @albertzaharovits @tvernum for awareness |
Thanks for testing and digging into things @ywangd ! These two are bugs for sure. On the first point, about open-point-in-time requests that contain only remote indices, I think the fix should be simple add The other one should also be easy to fix, I would start from elasticsearch/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java Line 294 in cbbe2d7
Can you take it home and raise the fix PRs as well ? |
I am happy to raise a following PR once this one is merged if that's what you are asking. |
server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java
Outdated
Show resolved
Hide resolved
This commit integrates point in time into cross cluster search. Relates elastic#61062 Closes elastic#61790
When target indices are remote only, CCS does not require user to have privileges on the local cluster. This PR ensure Point-In-Time reader follows the same pattern. Relates: #61827
…62261) When target indices are remote only, CCS does not require user to have privileges on the local cluster. This PR ensure Point-In-Time reader follows the same pattern. Relates: elastic#61827
This commit integrates point in time into cross cluster search.
0a99df6 -> Closes #61790
Relates #61062