Skip to content

Conversation

@epugh
Copy link
Contributor

@epugh epugh commented Jan 22, 2026

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.

Copy link
Contributor

Copilot AI left a comment

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
Copy link
Contributor

janhoy commented Jan 22, 2026

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
Copy link
Contributor

janhoy commented Jan 22, 2026

A pity that #3810 is not yet in.

@rahulgoswami
Copy link
Contributor

rahulgoswami commented Jan 22, 2026

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
Contributor

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.

3 participants