Repository navigation
[Backport 3.9] Resolve cross-cluster index schemas through the remote cluster's GetMappings (#5844) - #5869
Conversation
… cluster's GetMappings (opensearch-project#5844) PPL removed the "cluster:" prefix from a cross-cluster index name and read its mapping from the local cluster, which cannot see remote clusters (OpenSearch#6573). A query such as source=remote:logs-* failed with "no such index" unless the same index existed locally. The node client now groups index names by cluster, the same way search does, and reads the mapping and settings of remote indices from each remote cluster with its own client. Local indices are unchanged, and callers no longer split or strip names. RemoteClusterService is passed into the client through a provider that the plugin creates and TransportPPLQueryAction fills at startup. Errors match a search: a missing index, an unreachable remote, and a missing permission each report their own error, and skip_unavailable is applied per cluster. If every remote cluster in a source is skipped and no local index is named, there are no fields to query, so the query fails and names the skipped clusters. Remote schemas are cached for 60 seconds per user, so field-level security is respected. Resolves opensearch-project#4551 Conflicts in SQLPlugin and TransportPPLQueryAction: 3.9 has no async query support (opensearch-project#5832), so only the RemoteClusterServiceProvider wiring is added. Signed-off-by: Ajimelec Gonzalez <ajimelec@amazon.com> (cherry picked from commit ccb58da)
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (63.10%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## 3.9 #5869 +/- ##
============================================
+ Coverage 62.98% 63.10% +0.12%
- Complexity 8824 8865 +41
============================================
Files 939 942 +3
Lines 40156 40294 +138
Branches 4514 4532 +18
============================================
+ Hits 25291 25427 +136
+ Misses 14058 14056 -2
- Partials 807 811 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Backport of #5844 to
3.9: PPL reads the mapping and settings ofcluster:indexnames from each remote cluster, so cross-cluster queries such assource=remote:logs-*work without a local copy of the index.The automatic backport failed on two conflicts, resolved by hand:
SQLPlugin.javaandTransportPPLQueryAction.java:3.9doesn't have async query support ([FEATURE] Async PPL query submission and result retrieval #5832), so only theRemoteClusterServiceProviderparameter and wiring from [Feature] Resolve cross-cluster index schemas through the remote cluster'sGetMappings(#4551) #5844 are added. The other 15 files cherry-pick unchanged and matchmain.Tested on
3.9:spotlessCheck, all unit tests, the fullintegTestWithSecurity(including the 98 cross-cluster tests), and the fullintegTestpass.Related Issues
Backport of #5844
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.