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

[Discover] Change context query to prevent duplicates #77014

Conversation

kertal
Copy link
Member

@kertal kertal commented Sep 9, 2020

Summary

Additionally to the cases that were fixed in #38873 there could be a duplicates in a repeater are not allowed error when the same document is returned with different _doc values. The value of _doc can differ e.g. if the same ES replica isn't used for 2 requests, or if there's a merge occurring between 2 requests (Context uses several requests to build the list, and in the error case the anchor document is also returned in the previous/next documents, with a different _doc value, so the internal id that Angular uses to track the displayed records is no longer unique). This solution filters out the anchor document of the previous and next documents.

fixes #76283

Note about testing: there is no good way to test this, AFAIK there is no reliable way to reproduce the state of differing _doc values

Checklist

Delete any items that are not applicable to this PR.

@kertal kertal requested a review from a team September 9, 2020 08:16
@kertal kertal marked this pull request as draft September 9, 2020 08:16
@kertal kertal self-assigned this Sep 9, 2020
@kertal kertal added the Feature:Discover Discover Application label Sep 9, 2020
@kertal
Copy link
Member Author

kertal commented Sep 14, 2020

@elasticmachine merge upstream

@kertal kertal marked this pull request as ready for review September 30, 2020 08:48
@kertal kertal added :KibanaApp/fix-it-week Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Sep 30, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@kertal
Copy link
Member Author

kertal commented Sep 30, 2020

@elasticmachine merge upstream

@kertal
Copy link
Member Author

kertal commented Oct 1, 2020

@elasticmachine merge upstream

Copy link
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Code LGTM 👍 .
I tried to reproduce it locally, with no results 😓 .

@kertal
Copy link
Member Author

kertal commented Oct 2, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
discover 430.6KB 430.7KB +73.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kertal kertal merged commit d772c8c into elastic:master Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover] Context Angular error when there are documents with duplicate ids
4 participants