-
Notifications
You must be signed in to change notification settings - Fork 808
SOLR-18118: Add in --prompts to bin/solr start -e cloud to automatically respond to prompts #4127
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
base: main
Are you sure you want to change the base?
Conversation
|
@rahulgoswami could you check out the |
malliaridis
left a comment
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.
--prompt=2,8983,8984,"mycollection",2,2,_default
This seems kind of cryptic and the order can easily be messed up. It is very easy to make mistakes, imagine following scenarios:
User confuses the order of ports and shards / replicas, the prompt:
--prompts=2,2,2,"mycollection",8983,8984,_defautOr the user used
--prompts=2,8983,8984,"mycollection",2,2,_defautand now comes up with "oh, lets try 3 instead of 2 nodes" and just updates the prompts like
--prompts=3,8983,8984,"mycollection",2,2,_defautor user may think using it like
--prompts 3 8983 8984 "mycollection" 2 2 "_default"So I feel like there are too many wrong inputs possible.
I would rather prefer more params where we clearly distinguish the input data too. If it is supposed for automation, we still should maintain the readability and avoid "magic numbers". I would personally prefer options like --node-count=2, --node-ports=8983,8984 and so on, so that it is at least clear what the user is setting and the order doesn't matter.
Although not exactly the same, clig.dev says:
If you’ve got two or more arguments for different things, you’re probably doing something wrong.
source
The windows script also fails with
> bin\solr.cmd start -e cloud --prompts 3,8983,8984,8985,"my_collection",6,3,"_default"
Invalid command-line option: 3
Usage: solr start [-f] [--user-managed] [...]It seems that CMD is splitting the params by commas, so it fails after trying to parse the argument 3. In order to make it work I had to make the following changes:
:set_prompt
set "PASS_TO_RUN_EXAMPLE=--prompts %2 !PASS_TO_RUN_EXAMPLE!"
SHIFT # <-- Add a second shift to remove the argument of --prompts
SHIFT
goto parse_argsAdditionally update --prompt to --prompts (see other comments), and then run the command as
> bin\solr.cmd start -e cloud --prompts "3,8983,8984,8985,my_collection,6,3,_default" so that it is not split by comma (annoying, I know).
With these changes it worked on Windows, but I do not like it so much. The texts that are printed give the false impression that the user is supposed to make some prompt (they should be suppressed instead).
The --prompts is also specific to --e cloud, is it supposed to work for the other examples as well? If not, should it be listed in the start command, if it is only valid for -e cloud?
|
yeah, so there are some weasel words in the description of |
https://issues.apache.org/jira/browse/SOLR-18118
Description
Populate the prompts that bin/solr start -e cloud makes with preset answers. Prompts.... in the old school sense of the word ;-)
This would be MOST valuable if we could backport it to 9x, so we can test 9 against 10. However, even if it only makes it into 10.1, well, we can test 11 and 10 ;-)
Solution
A bit of refactoring in how we read in choices. A new
--prompt=2,8983,8984,"mycollection",2,2,_defaultsetting that provides comma delimited values.Tests
Added a test and manual testing.