-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[PIT finder] return empty generator if first page is empty #171598
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
Merged
pgayvallet
merged 8 commits into
elastic:main
from
pgayvallet:kbn-xxx-PIT-finder-empty-page
Nov 27, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5b8fc73
[PIT finder] return empty generator if first page is empty
pgayvallet 5e47e7a
Merge branch 'main' into kbn-xxx-PIT-finder-empty-page
kibanamachine 7040c65
Merge remote-tracking branch 'upstream/main' into kbn-xxx-PIT-finder-…
pgayvallet 47cceaa
Merge remote-tracking branch 'upstream/main' into kbn-xxx-PIT-finder-…
pgayvallet 6d48e10
Merge branch 'main' into kbn-xxx-PIT-finder-empty-page
kibanamachine d9ee81e
always yield first page if aggregations are specified.
pgayvallet cfe8bfd
Merge remote-tracking branch 'upstream/main' into kbn-xxx-PIT-finder-…
pgayvallet e3e2b14
add test and improve comment
pgayvallet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Even if this is an edge case, it is possible to specify aggregations with a PIT search, and this is effectively done at least once in our code:
kibana/x-pack/plugins/fleet/server/services/security/uninstall_token_service/index.ts
Lines 266 to 276 in 0ae3b23
Note that this specific usage could be adapted (given there isn't any reason to use a PIT search here), but we scenario remains valid more globally, so we still have to check for aggregations and yield, otherwise there's no way for the API consumers to retrieve their aggregation results in case of empty hits.
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.
cc @elastic/fleet as you may want to adapt this snippet to use a standard
SOR.findcall instead of a PIT given you break on first page.