-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Change index removal reason when IndicesService is stopping #65816
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
Change index removal reason when IndicesService is stopping #65816
Conversation
|
Pinging @elastic/es-distributed (Team:Distributed) |
DaveCTurner
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.
Hmm today CLOSED means POST /index/_close and friends, I don't think we should combine that with "shutting down". If we need the distinction, can we add a new value for the IndexRemovalReason enum instead?
|
Maybe |
|
|
|
Thanks David, I updated the reason. |
DaveCTurner
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.
I checked for, but did not find, places where we branch based on the index removal reason which would need updating too.
|
Thanks David. I checked too before opening the PR and did not found anything that would need to be adapted. |
…65816) When IndicesService is stopping on a data node, it closes every IndexService instances that are existing by calling the removeIndex(Index, IndexRemovalReason, String) method. The IndexRemovalReason that is passed as a parameter in this case is NO_LONGER_ASSIGNED which is also the one passed in other situation like removing an index because it got assigned to another data node. The fact that the same reason is used in multiple cases make it difficult for IndexEventListener to do the distinction between an index closed because the node is shutting down and an index closed between it moved away. This commit changes the IndexRemovalReason used when closing the IndicesService to be SHUTDOWN.
…65876) When IndicesService is stopping on a data node, it closes every IndexService instances that are existing by calling the removeIndex(Index, IndexRemovalReason, String) method. The IndexRemovalReason that is passed as a parameter in this case is NO_LONGER_ASSIGNED which is also the one passed in other situation like removing an index because it got assigned to another data node. The fact that the same reason is used in multiple cases make it difficult for IndexEventListener to do the distinction between an index closed because the node is shutting down and an index closed between it moved away. This commit changes the IndexRemovalReason used when closing the IndicesService to be SHUTDOWN.
When
IndicesServiceis stopping on a data node, it closes everyIndexServiceinstances that are existing by calling theremoveIndex(Index, IndexRemovalReason, String)method.The
IndexRemovalReasonthat is passed as a parameter in this case isNO_LONGER_ASSIGNEDwhich is also the one passed in other situation like removing an index because it got assigned to another data node. The fact that the same reason is used in multiple cases make it difficult forIndexEventListenerto do the distinction between an index closed because the node is shutting down and an index closed between it moved away.This pull request changes the
IndexRemovalReasonused when closing theIndicesServiceto beCLOSEDthat, I think, better reflect the reason whyIndexServiceare closed.