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

Remove redundant success counter from AbstractSearchAsyncAction #124941

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

original-brownbear
Copy link
Member

No need to count successes explicitly, the failure count and total count contain all the necessary information here (a fact we asserted also).

This removal also revealed some dead-code in the phase transition method that really only trigged in a test with invalid inputs (5 shards, but only a single shard iterator, not calling start on the action). I removed that test, at this point it was just testing itself.

The beauty of this change is that it essentially only leaves the outstandingShards counter as shared state across all shards. A suggested follow-up would be to do away with that as well and move to a tree of futures for the per-shard results that scales more cleanly on larger boxes and makes reasoning about the concurrency easier to the point where we can do away with all the atomic array.

No need to count successes explicitly, the failure count and total count
contain all the necessary information here (a fact we asserted also).
This removal also revealed some dead-code in the phase transition method.
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Mar 15, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants