Avoid double decrement on current query counter#24922
Merged
jasontedor merged 1 commit intoelastic:masterfrom May 27, 2017
Merged
Avoid double decrement on current query counter#24922jasontedor merged 1 commit intoelastic:masterfrom
jasontedor merged 1 commit intoelastic:masterfrom
Conversation
This commit fixes a double decrement bug on the current query counter. The double decrement arises in a situation when the fetch phase is inlined for a query that is only touching one shard. After the query phase succeeds we decrement the current query counter. If the fetch phase ultimately fails, an exception is thrown and we decrement the current query counter again in the catch block. We also add assertions that all current stats counters remain non-negative at all times.
Member
|
LGTM |
Member
Author
|
This bug exists since v5.3.0. Writing a test for this specific situation seems challenging yet the existing test suite HighlighterSearchIT already fails on the seed 85A57E5C8816392C with the assertions added but not the fix; with the fix the suite succeeds again. I am going to consider this sufficient unless someone has a clever idea for an easy way to write a test here. If it's agreed that writing a test for this situation is indeed not easy yet we insist on having a test, I would lean towards it being done in a follow-up as we've started to see a few reports of this issue and we should not hold a fix up. |
jasontedor
added a commit
that referenced
this pull request
May 27, 2017
This commit fixes a double decrement bug on the current query counter. The double decrement arises in a situation when the fetch phase is inlined for a query that is only touching one shard. After the query phase succeeds we decrement the current query counter. If the fetch phase ultimately fails, an exception is thrown and we decrement the current query counter again in the catch block. We also add assertions that all current stats counters remain non-negative at all times. Relates #24922
jasontedor
added a commit
that referenced
this pull request
May 27, 2017
This commit fixes a double decrement bug on the current query counter. The double decrement arises in a situation when the fetch phase is inlined for a query that is only touching one shard. After the query phase succeeds we decrement the current query counter. If the fetch phase ultimately fails, an exception is thrown and we decrement the current query counter again in the catch block. We also add assertions that all current stats counters remain non-negative at all times. Relates #24922
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.
This commit fixes a double decrement bug on the current query counter. The double decrement arises in a situation when the fetch phase is inlined for a query that is only touching one shard. After the query phase succeeds we decrement the current query counter. If the fetch phase ultimately fails, an exception is thrown and we decrement the current query counter again in the catch block. We also add assertions that all current stats counters remain non-negative at all times.
Relates #22996, closes #24872