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

Make sure successful operations are correct if second search phase is fast #5713

Merged
merged 2 commits into from Apr 7, 2014

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Apr 7, 2014

In TransportSearchTypeAction we need to increment successful ops first before we increment and compare the exit condition otherwise if we are fast we could concurrently update totalOps but then preempt one of the threads which can cause the successor to read a wrong value from successfulOps if second phase is very fast ie. searchType == count etc. This can cause wrong success stats in the search response.

Recently this caused several test failures because we assert on correct successful shards in count / search

@kimchy
Copy link
Member

kimchy commented Apr 7, 2014

LGTM

In TransportSearchTypeAction we  need to increment successful ops
first before we increment and compare the exit condition otherwise if we
are fast we could concurrently update totalOps but then preempt one
of the threads which can cause the successor to read a wrong value from
successfulOps if second phase is very fast ie. searchType == count etc.
This can cause wrong success stats in the search response.
@s1monw s1monw added bug labels Apr 7, 2014
@s1monw s1monw merged commit 49c74e0 into elastic:master Apr 7, 2014
@s1monw s1monw deleted the correct_successful_shard_counts branch April 7, 2014 20:27
@clintongormley clintongormley added the :Search/Search Search-related issues that do not fall into other categories label Jun 7, 2015
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 v1.0.3 v1.1.1 v1.2.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants