-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Sets the new engine before closing the previous one in IndexShard.resetEngine #122255
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
Conversation
|
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
fcofdez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for fixing this
kingherc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one. Just one comment before approving.
server/src/main/java/org/elasticsearch/index/shard/IndexShard.java
Outdated
Show resolved
Hide resolved
arteam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks all! |
Current code closes the previous engine instance, creates the new engine and then updates the
currentEngineReference:This leaves more room for callers of
getEngineOrNull()to pick a closed instance. Instead we can create the new engine first and atomically update the reference to the new instance.