-
Notifications
You must be signed in to change notification settings - Fork 658
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
bin/solr in branch_9_7 has commands that fail #2710
Conversation
Look at that! in 9.6, |
This is generating some other refactorings which will be fun to bring to main and 9x seperately!
Found that HealthcheckTool isn't working in 9.7 either.. and our Bats test doesn't refute the right "ERROR", only "error" ;-). |
…he other or we default to localhost.
Okay, I think this is ready for review and commit. I am thinking that I move the bats tests in another PR to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for quick PR. Looking good, not taken it for a spin, but very nice with the BATS tests.
Will we need edit to solr.cmd
you think?
try (var solrClientForCollection = SolrCLI.getSolrClient(coreUrl)) { | ||
|
||
// SolrCLI.getSolrClient converts the coreUrl back into a root Solr url, but we need to | ||
// talk to specific core so manually creating the client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, would you say this is a bug, or is it well documented in the javadoc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Humm..... I read it and it says:
/**
* Get a SolrClient for the given URL. The URL can be with or without /solr suffix, the method
* will normalize it and add '/solr'. To support certain unit tests, the hostContext can be
* overridden via the system property 'hostContext'.
*
* <p>Note that from Solr 10.0 Solr will use / as base URL to support /api and other contexts, so
* handling of hostContext differs between Solr 9.x and 10.x.
*
* @param solrUrl the base URL of Solr
* @return a SolrClient initialized with correct hostContext, default '/solr'
*/
public static SolrClient getSolrClient(String solrUrl) {
I think this is the only place we need a core specific url... Do you think it should support that use case as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked a bit more at the code, and decided to go with the javadoc approach!
solr/packaging/test/test_create.bats
Outdated
solr assert --started http://localhost:${SOLR_PORT} --timeout 5000 | ||
|
||
run solr create -c COLL_NAME -V | ||
assert_output --partial "Created new core 'COLL_NAME'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not this assert a string that is only printed in verbose mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question... I think for core, you got this message, and for collection, you got a different dump (that was more like the api response). I changed it so that both core and collection output a short message like this, and then if you add the -v
then you ALSO see the api responses... Does this work for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I just expected the assert to fail without the -V
, which it won't now since the text asserted is always printed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally understand what you mean, and am looking at it and then will merge.
I didn't try to have it be smart, like "Oh, you are using it with a core and throw an error"
Checked and yes, we had to fix healthcheck in |
@janhoy I've gone through and addressed (hopefully!) all your commits. Can I get a LGTM? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small additions from my side.
SolrCLI.OPTION_ZKHOST_DEPRECATED, | ||
SolrCLI.OPTION_VERBOSE_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be eventually
SolrCLI.OPTION_ZKHOST_DEPRECATED, | |
SolrCLI.OPTION_VERBOSE_DEPRECATED); | |
SolrCLI.OPTION_ZKHOST_DEPRECATED, | |
SolrCLI.OPTION_VERBOSE, | |
SolrCLI.OPTION_VERBOSE_DEPRECATED); |
SolrCLI.OPTION_ZKHOST_DEPRECATED, | ||
SolrCLI.OPTION_VERBOSE_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here:
SolrCLI.OPTION_ZKHOST_DEPRECATED, | |
SolrCLI.OPTION_VERBOSE_DEPRECATED); | |
SolrCLI.OPTION_ZKHOST_DEPRECATED, | |
SolrCLI.OPTION_VERBOSE, | |
SolrCLI.OPTION_VERBOSE_DEPRECATED); |
Can we update the title of this? is it just about CLI stuff? hard to know what this is about... |
Co-authored-by: Christos Malliaridis <[email protected]>
This was committed into branch_9x in #35ae5f7c55c27f463db048b975d06ec070fbbeef |
https://issues.apache.org/jira/browse/SOLR-XXXXX
Description
Fixes some bugs that existing in branch_9_7.
This has good stuff to port back to main and branch_9x...
Tests
New Bats tests added
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.