Skip to content
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

SOLR-16823: remove the old backcompat formats for bin/solr zk -upconfig and -downconfig #1672

Merged
merged 3 commits into from
Jun 15, 2023

Conversation

epugh
Copy link
Contributor

@epugh epugh commented May 30, 2023

https://issues.apache.org/jira/browse/SOLR-16823

Description

Remove the bin/solr and bin/solr.cmd zk -upconfig and -downconfig special handling in favour of the standard bin/solr zk upconfig and bin/solr zk downconfig commands.

Solution

Remove special handling logic. This is only meant to be committed to main.

Tests

Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.

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)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

@epugh
Copy link
Contributor Author

epugh commented Jun 9, 2023

Stuck on figuring out a windows box to test the solr.cmd changes ;-). Maybe my teen will let me use his gaming rig for testing?

@epugh
Copy link
Contributor Author

epugh commented Jun 15, 2023

@Willdotwhite this is the small change to solr.cmd that I think is good to go but I can't validate!

@Willdotwhite
Copy link
Contributor

Cheers @epugh ! I'll take a look at replicating this and update in a bit before I look at #1670 👍🏻

@Willdotwhite
Copy link
Contributor

Willdotwhite commented Jun 15, 2023

I've not actually got ZK set up for this example, I thought a less-verbose output showing that -upconfig and -downconfig no longer function would be best; is this ok to validate your expected behaviour on Windows (Windows 10.0.19045 Build 19045)?

upconfig:

PS C:\Users\Will\Projects\solr\solr\bin> .\solr.cmd zk upconfig -d . -n test -z localhost:1234   
Error: Could not find or load main class org.apache.solr.cli.SolrCLI    
Caused by: java.lang.ClassNotFoundException: org.apache.solr.cli.SolrCLI

---

PS C:\Users\Will\Projects\solr\solr\bin> .\solr.cmd zk -upconfig -d . -n test -z localhost:1234
 ERROR: Invalid command specified for zk sub-command

 Usage: solr zk upconfig|downconfig -d <confdir> -n <configName> [-z zkHost]
        solr zk cp [-r] <src> <dest> [-z zkHost]
        solr zk rm [-r] <path> [-z zkHost]
        solr zk mv <src> <dest> [-z zkHost]
        solr zk ls [-r] <path> [-z zkHost]
        solr zk mkroot <path> [-z zkHost]

Type bin/solr zk -help for full usage help

downconfig:

PS C:\Users\Will\Projects\solr\solr\bin> .\solr.cmd zk downconfig -d . -n test -z localhost:1234
Error: Could not find or load main class org.apache.solr.cli.SolrCLI    
Caused by: java.lang.ClassNotFoundException: org.apache.solr.cli.SolrCLI

---

PS C:\Users\Will\Projects\solr\solr\bin> .\solr.cmd zk -downconfig -d . -n test -z localhost:1234
 ERROR: Invalid command specified for zk sub-command

 Usage: solr zk upconfig|downconfig -d <confdir> -n <configName> [-z zkHost]
        solr zk cp [-r] <src> <dest> [-z zkHost]                            
        solr zk rm [-r] <path> [-z zkHost]                                  
        solr zk mv <src> <dest> [-z zkHost]                                 
        solr zk ls [-r] <path> [-z zkHost]                                  
        solr zk mkroot <path> [-z zkHost]                                   
                                                                            
Type bin/solr zk -help for full usage help      

@epugh
Copy link
Contributor Author

epugh commented Jun 15, 2023

Your approach makes sense to me. Did I do something though to make that java.lang.ClassNotFoundException: org.apache.solr.cli.SolrCLI error happen? do the other more typical commands still work? Like solr.cmd start ?

@Willdotwhite
Copy link
Contributor

No, sorry, that's me being lazy - that's from ./solr/solr/bin, and not ./solr/solr/packaging/build/dev/bin. so there's no compiled code. Running things properly looks like this:

PS C:\Users\Will\Projects\solr\solr\packaging\build\dev\bin> .\solr.cmd zk upconfig -d . -n test -z localhost:1234
WARN  - 2023-06-15 20:27:44.532; org.apache.solr.common.cloud.SolrZkClient; Using default ZkCredentialsInjector. ZkCredentialsInjector is not secure, it creates an empty list of credentials which leads to 'OPEN_ACL_UNSAFE' ACLs to Z
ookeeper nodes
Terminate batch job (Y/N)? Y
PS C:\Users\Will\Projects\solr\solr\packaging\build\dev\bin> .\solr.cmd start
Java 17 detected. Enabled workaround for SOLR-16463
OpenJDK 64-Bit Server VM warning: JVM cannot use large page memory because it does not have enough privilege to lock pages in memory.
WARNING: A command line option has enabled the Security Manager
WARNING: The Security Manager is deprecated and will be removed in a future release
Waiting up to 30 seconds to see Solr running on port 8983
Started Solr server on port 8983. Happy searching!
PS C:\Users\Will\Projects\solr\solr\packaging\build\dev\bin> 

@epugh
Copy link
Contributor Author

epugh commented Jun 15, 2023

Awesome... Okay, going to merge!

@epugh epugh merged commit a8b7515 into apache:main Jun 15, 2023
5 checks passed
epugh added a commit that referenced this pull request Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants