Remove buggy indices.exists() calls from code#1580
Merged
DJRickyB merged 7 commits intoelastic:masterfrom Sep 14, 2022
Merged
Conversation
added 2 commits
September 13, 2022 14:30
nik9000
reviewed
Sep 13, 2022
Member
nik9000
left a comment
There was a problem hiding this comment.
It's ok by me! What a wild ride. Probably worth a comment about why using get instead of exists and maybe even an assertion that you are on the un-fixed version of the client. Once you upgrade I think you want to revert this commit, right?
Contributor
Author
|
@elasticmachine run rally/rally-tracks-compat |
michaelbaamonde
approved these changes
Sep 14, 2022
Contributor
michaelbaamonde
left a comment
There was a problem hiding this comment.
LGTM. Thanks so much for chasing this down.
Another point in favor of prioritizing the client upgrade.
This was referenced Sep 14, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Recently we've had a few errors surface in Rally executions when indices/data-streams are deleted. The errors would be reported as
connection timed outfor theDELETE /<index>call, but when inspected (via a packet capture) the server was shown to have responded correctly and in a timely fashion to Rally.It turns out that in our version of
elasticsearch-py,indices.exists()calls were handled via GET rather than HEAD. It's unclear to me why this causes an issue, but any of the following fixes the issue when targeting very large indices with thedelete-indexoperation:only-if-existstofalsein the operation (to avoid theexists()call)exists()call to aget()call.I'm led to believe the bytes from the body are left in the event loop and not dequeued properly by the client, hence blocking somehow the response from the very next transaction.
This PR changes from using the
exists()method to using theget()method to determine an index's existence.A test is updated to show the difference in behavior under-the-hood.