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

Use IndexShard from reader context #57384

Merged
merged 3 commits into from
Jun 4, 2020

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented May 29, 2020

Previously, we resolve IndexService and IndexShard once when creating a search context. However, since #51282, we resolve them in every phase as we recreate a search context in each phase. This change can cause the dfs_query or fetch phase to fail with ShardNotFoundException while previously did not. This behavior is quite subtle, but I think we should make it in line with the master branch.

CI: testRecoverWhileUnderLoadAllocateReplicasRelocatePrimariesTest

@dnhatn dnhatn added >feature :Search/Search Search-related issues that do not fall into other categories labels May 29, 2020
@dnhatn dnhatn requested a review from jimczi May 29, 2020 20:54
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label May 29, 2020
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.

Good catch. I think we should also retrieve or create the reader context here and here. The shard might be deleted at this point so we need to retrieve the infos from the reader context if it exists.

@dnhatn
Copy link
Member Author

dnhatn commented Jun 4, 2020

@jimczi I've pushed 7426031.

@dnhatn dnhatn requested a review from jimczi June 4, 2020 15:11
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.

LGTM

@dnhatn
Copy link
Member Author

dnhatn commented Jun 4, 2020

Thanks Jim!

@dnhatn dnhatn merged commit 0d0d647 into elastic:reader-context Jun 4, 2020
@dnhatn dnhatn deleted the use-shard-from-reader-context branch June 4, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants