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

[data views] index negation doesn't work with cross cluster search #147926

Closed
mattkime opened this issue Dec 21, 2022 · 3 comments · Fixed by #147968
Closed

[data views] index negation doesn't work with cross cluster search #147926

mattkime opened this issue Dec 21, 2022 · 3 comments · Fixed by #147968
Labels
bug Fixes for quality problems that affect the customer experience Feature:Data Views Data Views code and UI - index patterns before 8.0 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)

Comments

@mattkime
Copy link
Contributor

the index pattern *:remote_test_index_*,*:-remote_test_index_2 will pull in fields from remote_test_index_2

@botelastic botelastic bot added the needs-team Issues missing a team label label Dec 21, 2022
@mattkime
Copy link
Contributor Author

I've reproduced the problem. I working on looking at the request between Kibana and ES to see where the bug exists. Field caps works as expected, meaning it doesn't exhibit the bug.

@lukeelmers lukeelmers added the Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) label Dec 21, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@mattkime
Copy link
Contributor Author

Update - I was able to see the problem by turning on elasticsearch query logging in kibana. Kibana was swallowing cross cluster negation index patterns - there's code that checks for negation patterns but it fails to handle the cross cluster ones. I'm now working to determine whether I should specifically handle cross cluster patterns or whether the validation code can be removed entirely.

@kertal kertal added bug Fixes for quality problems that affect the customer experience Feature:Data Views Data Views code and UI - index patterns before 8.0 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. labels Dec 29, 2022
mattkime added a commit that referenced this issue Dec 29, 2022
## Summary

The data views api examines comma delimited sections to see if there are
matching indices before fetching the field list. The existing code
checked for index pattern negation - patterns that started with a `-`.
However, it didn't check for this in cross cluster case -
`this_cluster:-kibana*`. The code now handles the cross cluster case
appropriately.

Still, its unclear to me whether this logic is necessary, hence why I
opened #147970 - I was able to
resolve the failed tests most familiar to me but I will need to work
with engineers from other teams to investigate other failures.

Closes #147926
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Dec 29, 2022
## Summary

The data views api examines comma delimited sections to see if there are
matching indices before fetching the field list. The existing code
checked for index pattern negation - patterns that started with a `-`.
However, it didn't check for this in cross cluster case -
`this_cluster:-kibana*`. The code now handles the cross cluster case
appropriately.

Still, its unclear to me whether this logic is necessary, hence why I
opened elastic#147970 - I was able to
resolve the failed tests most familiar to me but I will need to work
with engineers from other teams to investigate other failures.

Closes elastic#147926

(cherry picked from commit e3cac21)
kibanamachine added a commit that referenced this issue Dec 29, 2022
… (#148206)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[data views] allow cross cluster index pattern negation
(#147968)](#147968)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-12-29T15:51:20Z","message":"[data
views] allow cross cluster index pattern negation (#147968)\n\n##
Summary\r\n\r\nThe data views api examines comma delimited sections to
see if there are\r\nmatching indices before fetching the field list. The
existing code\r\nchecked for index pattern negation - patterns that
started with a `-`.\r\nHowever, it didn't check for this in cross
cluster case -\r\n`this_cluster:-kibana*`. The code now handles the
cross cluster case\r\nappropriately.\r\n\r\nStill, its unclear to me
whether this logic is necessary, hence why I\r\nopened
#147970 - I was able to\r\nresolve
the failed tests most familiar to me but I will need to work\r\nwith
engineers from other teams to investigate other failures.\r\n\r\nCloses
#147926
Views","Team:DataDiscovery","backport:prev-minor","v8.7.0"],"number":147968,"url":"#147968
views] allow cross cluster index pattern negation (#147968)\n\n##
Summary\r\n\r\nThe data views api examines comma delimited sections to
see if there are\r\nmatching indices before fetching the field list. The
existing code\r\nchecked for index pattern negation - patterns that
started with a `-`.\r\nHowever, it didn't check for this in cross
cluster case -\r\n`this_cluster:-kibana*`. The code now handles the
cross cluster case\r\nappropriately.\r\n\r\nStill, its unclear to me
whether this logic is necessary, hence why I\r\nopened
#147970 - I was able to\r\nresolve
the failed tests most familiar to me but I will need to work\r\nwith
engineers from other teams to investigate other failures.\r\n\r\nCloses
#147926
views] allow cross cluster index pattern negation (#147968)\n\n##
Summary\r\n\r\nThe data views api examines comma delimited sections to
see if there are\r\nmatching indices before fetching the field list. The
existing code\r\nchecked for index pattern negation - patterns that
started with a `-`.\r\nHowever, it didn't check for this in cross
cluster case -\r\n`this_cluster:-kibana*`. The code now handles the
cross cluster case\r\nappropriately.\r\n\r\nStill, its unclear to me
whether this logic is necessary, hence why I\r\nopened
#147970 - I was able to\r\nresolve
the failed tests most familiar to me but I will need to work\r\nwith
engineers from other teams to investigate other failures.\r\n\r\nCloses
#147926"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Data Views Data Views code and UI - index patterns before 8.0 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)
Projects
None yet
4 participants