Repository navigation
SOLR-18569: Cleanup ephem /node_roles/... on process exit - #5237
Merged
gerlowskija merged 2 commits intoOct 30, 2026
Merged
Conversation
Solr has long had code in ZkController to check whether the ephemeral /live_node entry from a previous process is still around, and wait for ZK to deleted it before proceeding. But /live_node entries aren't the only ephemeral nodes that Solr expects to create on startup and that can linger after process exit. The /node_roles/ tree also contains ephemeral nodes. Currently, if any of these exist at startup-time, Solr will hit a NodeExists exception from ZK and fail to start up. This commit changes ZkController's init code so that it now waits for these nodes as well. In practice, this prevents Solr from potentially stalling on start up because of an unexpected or unhandled NodeExists exception. Co-authored-by: Nick Shanin <nick.boss.us@gmail.com>
Logic already existed on 'main' and 'branch_10x', but wasn't present in our 9x codeline.
Contributor
|
Looks good. Optional coverage: multiple leftover entries and repeated cleanup. |
anshumg
approved these changes
Oct 26, 2026
gerlowskija
added a commit
that referenced
this pull request
Oct 30, 2026
Co-authored-by: Nick Shanin <nick.boss.us@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-18569
Description
'main' and 'branch_10x' have logic on Solr shutdown that cleans up any ephemeral
/node_role/...entries owned by the process being shutdown, but this change never made it to branch_9x.Solution
This commit backports this logic to branch_9x. It also backports #5211, which has some related functionality.
Tests
Test cases in ZkControllerTest
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.