Skip to content

SOLR-18569: Cleanup ephem /node_roles/... on process exit - #5237

Merged
gerlowskija merged 2 commits into
apache:branch_9xfrom
gerlowskija:SOLR-18569-9x-backport
Oct 30, 2026
Merged

gerlowskija merged 2 commits into
apache:branch_9xfrom
gerlowskija:SOLR-18569-9x-backport

Conversation

@gerlowskija

Copy link
Copy Markdown
Contributor

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:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.

gerlowskija and others added 2 commits October 26, 2026 13:39
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.
@nick-boss-tech

Copy link
Copy Markdown
Contributor

Looks good. Optional coverage: multiple leftover entries and repeated cleanup.

@gerlowskija
gerlowskija merged commit daa4b30 into apache:branch_9x Oct 30, 2026
4 checks passed
@gerlowskija
gerlowskija deleted the SOLR-18569-9x-backport branch October 30, 2026 15:26
gerlowskija added a commit that referenced this pull request Oct 30, 2026
Co-authored-by: Nick Shanin <nick.boss.us@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants