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

Fold InitialSearchPhase into AbstractSearchAsyncAction #47182

Merged

Conversation

javanna
Copy link
Member

@javanna javanna commented Sep 26, 2019

Historically, we have two base classes for search actions that generally need to fan out to multiple shards and then move on to the following phase: InitialSearchPhase and AbstractSearchAsyncAction that extends it. Practically, every search action extends the latter, and there are no direct subclasses of InitialSearchPhase in our codebase.

This commit folds InitialSearchPhase into AbstractSearchAsyncAction in the attempt of simplifying things and making the search code running on the coordinating node easier to reason about.

Historically, we have two base classes for search actions that generally need to fan out to multiple shards and then move on to the following phase: InitialSearchPhase and AbstractSearchAsyncAction that extends it. Practically, every search action extends the latter, and there are no direct subclasses of InitialSearchPhase in our codebase.

This commit folds InitialSearchPhase into AbstractSearchAsyncAction in the attempt of simplifying things and making the search code running on the coordinating node easier to reason about.
@javanna javanna added >enhancement :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.5.0 labels Sep 26, 2019
@javanna javanna requested a review from jimczi September 26, 2019 19:23
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

latch.countDown();
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I am curious to hear if I am over-simplifying things here. This is how the next phase used to be before #27069 . I wonder if it's necessary for the next phase to be an AbstractSearchAsyncAction subclass at this point, which is not so easy to recreate.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to keep since this test checks random failures too ? We can maybe just override executePhaseOnShard but I am not sure if onShardFailure is also needed ?

@javanna
Copy link
Member Author

javanna commented Sep 26, 2019

run elasticsearch-ci/2

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

Nice cleanup, I left one comment regarding a test but lgtm otherwise.

latch.countDown();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to keep since this test checks random failures too ? We can maybe just override executePhaseOnShard but I am not sure if onShardFailure is also needed ?

@jimczi
Copy link
Contributor

jimczi commented Sep 27, 2019

@elasticmachine update branch

@javanna javanna merged commit 4e6756f into elastic:master Oct 4, 2019
javanna added a commit to javanna/elasticsearch that referenced this pull request Oct 4, 2019
Historically, we have two base classes for search actions that generally need to fan out to multiple shards and then move on to the following phase: InitialSearchPhase and AbstractSearchAsyncAction that extends it. Practically, every search action extends the latter, and there are no direct subclasses of InitialSearchPhase in our codebase.

This commit folds InitialSearchPhase into AbstractSearchAsyncAction in the attempt of simplifying things and making the search code running on the coordinating node easier to reason about.
javanna added a commit that referenced this pull request Oct 7, 2019
Historically, we have two base classes for search actions that generally need to fan out to multiple shards and then move on to the following phase: InitialSearchPhase and AbstractSearchAsyncAction that extends it. Practically, every search action extends the latter, and there are no direct subclasses of InitialSearchPhase in our codebase.

This commit folds InitialSearchPhase into AbstractSearchAsyncAction in the attempt of simplifying things and making the search code running on the coordinating node easier to reason about.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v7.5.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants