Skip to content

--user-managed parameter is not being respected - #4070

Closed
epugh wants to merge 1 commit into
apache:mainfrom
epugh:fix_user_managed_startup_on_windows
Closed

epugh wants to merge 1 commit into
apache:mainfrom
epugh:fix_user_managed_startup_on_windows

Conversation

@epugh

@epugh epugh commented Jan 22, 2026 •

Copy link
Copy Markdown
Contributor

A potential fix for the bug that @rahulgoswami discovered during Solr 10 RC process.

Fix Summary

Problem: The solr.cmd script had a bug on line 920 that unconditionally set SOLR_MODE=solrcloud whenever ZK_HOST was defined, even when the user explicitly passed --user-managed.

Root Cause: Line 920 (IF NOT "%ZK_HOST%"=="" set SOLR_MODE=solrcloud) would override the SOLR_MODE=user-managed setting that was correctly set when the user passed the --user-managed flag.

Solution: Removed the problematic line 920. Now the logic works as follows:

  1. When --user-managed is passed, SOLR_MODE is set to user-managed (line 444)
  2. Later, if SOLR_MODE is still empty, it defaults to solrcloud (line 920, formerly 921)
  3. The SolrCloud-specific configuration only applies when SOLR_MODE=="solrcloud" (line 922)

This matches the behavior of the Unix solr script, which doesn't override SOLR_MODE based on ZK_HOST and respects the user's explicit choice of --user-managed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@janhoy

janhoy commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

The flow in this script is too hairy for me to review, so I politely asked Copilot to have a go

CC: @malliaridis who added the line in the first place in SOLR-17467 epugh@577e701

@janhoy

janhoy commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

A pity that #3810 is not yet in.

@rahulgoswami

rahulgoswami commented Jan 22, 2026 •

Copy link
Copy Markdown
Member

Thanks for the PR @epugh . Took this fix for a spin, but the behavior seems unchanged. Looking at #3347 where a similar issue was fixed.

@rahulgoswami

Copy link
Copy Markdown
Member

Fixed this in #4074.

@epugh epugh closed this Jan 23, 2026
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.

4 participants