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

Harden discard logic in ExchangeBuffer #100636

Merged
merged 6 commits into from
Oct 11, 2023
Merged

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Oct 10, 2023

We can leave pages in the ExchangeBuffer if the noMoreInputs flag is set to true after we've checked it but before we add pages to the queue. I can reliably reproduce the testFromLimit by inserting a delay in between. This change hardens the discard logic by moving the check after we've added a Page to the queue. If the noMoreInputs flag is set to true, we will drain the pages from the queue.

@dnhatn dnhatn requested a review from ChrisHegarty October 11, 2023 04:52
@dnhatn dnhatn marked this pull request as ready for review October 11, 2023 04:53
@elasticsearchmachine elasticsearchmachine added the Team:QL (Deprecated) Meta label for query languages team label Oct 11, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL)

Copy link
Contributor

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

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

Awesome! LGTM

@dnhatn
Copy link
Member Author

dnhatn commented Oct 11, 2023

Thanks, Chris!

@dnhatn dnhatn merged commit e411b57 into elastic:main Oct 11, 2023
@dnhatn dnhatn deleted the enable-limit-test branch October 11, 2023 13:56
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.11

dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Oct 11, 2023
We can leave pages in the ExchangeBuffer if the noMoreInputs flag is set 
to true after we've checked it but before we add pages to the queue. I
can reliably reproduce the testFromLimit by inserting a delay in
between. This change hardens the discard logic by moving the check after
we've added a Page to the queue. If the noMoreInputs flag is set to
true, we will drain the pages from the queue.
elasticsearchmachine pushed a commit that referenced this pull request Oct 11, 2023
We can leave pages in the ExchangeBuffer if the noMoreInputs flag is set 
to true after we've checked it but before we add pages to the queue. I
can reliably reproduce the testFromLimit by inserting a delay in
between. This change hardens the discard logic by moving the check after
we've added a Page to the queue. If the noMoreInputs flag is set to
true, we will drain the pages from the queue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants