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

Fix handling of terminate_after when size is 0 #58212

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Jun 16, 2020

terminate_after is ignored on search requests that don't return top hits (size set to 0)
and don't track the number of hits accurately (track_total_hits).
We use early termination when the number of hits to track is reached during collection
but this breaks the hard termination of terminate_after if it happens before we reached
the terminate_after value.
This change ensures that we continue to check terminate_after even if the tracking of total
hits has reached the provided value.

Closes #57624

`terminate_after` is ignored on search requests that don't return top hits (`size` set to 0)
and do not tracked the number of hits accurately (`track_total_hits`).
We use early termination when the number of hits to track is reached during collection
but this breaks the hard termination of `terminate_after` if it happens before we reached
the `terminate_after` value.
This change ensures that we continue to check `terminate_after` even if the tracking of total
hits has reached the provided value.

Closes elastic#57624
@jimczi jimczi added >bug :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.8.1 v7.9.0 labels Jun 16, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

LGTM

@jimczi jimczi merged commit 9e770ab into elastic:master Jun 24, 2020
@jimczi jimczi deleted the terminate_after_multi_collectorr branch June 24, 2020 11:15
jimczi added a commit that referenced this pull request Jun 24, 2020
`terminate_after` is ignored on search requests that don't return top hits (`size` set to 0)
and do not tracked the number of hits accurately (`track_total_hits`).
We use early termination when the number of hits to track is reached during collection
but this breaks the hard termination of `terminate_after` if it happens before we reached
the `terminate_after` value.
This change ensures that we continue to check `terminate_after` even if the tracking of total
hits has reached the provided value.

Closes #57624
jimczi added a commit that referenced this pull request Jun 24, 2020
`terminate_after` is ignored on search requests that don't return top hits (`size` set to 0)
and do not tracked the number of hits accurately (`track_total_hits`).
We use early termination when the number of hits to track is reached during collection
but this breaks the hard termination of `terminate_after` if it happens before we reached
the `terminate_after` value.
This change ensures that we continue to check `terminate_after` even if the tracking of total
hits has reached the provided value.

Closes #57624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v7.8.1 v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terminate_after uses heuristic hits value instead of actual
4 participants