-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fixes for handling SCYLLA_EXT_OPTS
correctly
#541
Conversation
when starting a cluster with an `SCYLLA_EXT_OPTS` env variable, if the user sets the smp or memory using the abbreviated option name (-c or -m), ScyllaDB will fail on startup due to double use of parameters. This is because scylla-ccm fails to account for --smp and -c (for example) as the same option, injecting the literal option into the command line parameters. Here we change this for --smp and --memory, with the option to add more similar cases in the future. Fixes scylladb#539 Signed-off-by: Eliran Sinvani <[email protected]>
Some scylla command lines options may and might appear more than once with different values, a concrete example for this, which this commit handles is `--experimental-features` when more than one experimental feature needs to be enabled. Fixes scylladb#540 Signed-off-by: Eliran Sinvani <[email protected]>
I will review this change once I am back from my PTO. |
@tchaikov ping |
ccmlib/scylla_node.py
Outdated
@@ -570,11 +570,12 @@ def process_opts(opts): | |||
opts_i += 1 | |||
val = ' '.join(vals) | |||
if key not in ext_args and not key.startswith("--scylla-manager"): | |||
ext_args[key] = val | |||
ext_args[args_translation_map.get(key, key)] = val |
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'd suggest normalize key
even before the if key not in ext_args and not key.startswith("--scylla-manager")
check, and do this unconditially. like:
key = args_translation_map.get(key, key)
if key not in ext_args and not key.startswith("--scylla-manager"):
ext_args[key] = val
for better readaiblity.
ext_args = OrderedDict() | ||
def should_add_option(key): |
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.
the nested function is more readable, but it also renders this method more complicated, how about this?
if key.startswith("--scylla-manager"):
continue
if key in allowed_duplicates_set:
ext_args.get(key, []).append(val)
elif key not in ext_args:
ext_args[key] = val
for following reasons:
- the combinations of conditions is getting convoluted in this function, better off simplifying them
dict.set_default()
helps to consolidate the logic, but it hurts the readability.- we should not use list for all values of options. the boxing-unboxing hurts the readability.
@eliransin hi Eliran, sorry for the latency. left a couple comments. |
since we have cases multiple `--experimental-features` needs to be passed via `SCYLLA_EXT_OPTS`, adding support for key with multiple values in `process_opts()` fixes: scylladb#540 closes: scylladb#541
since we have cases multiple `--experimental-features` needs to be passed via `SCYLLA_EXT_OPTS`, adding support for key with multiple values in `process_opts()` fixes: scylladb#540 closes: scylladb#541
since we have cases multiple `--experimental-features` needs to be passed via `SCYLLA_EXT_OPTS`, adding support for key with multiple values in `process_opts()` fixes: scylladb#540 closes: scylladb#541
closing in favor of #558 |
since we have cases multiple `--experimental-features` needs to be passed via `SCYLLA_EXT_OPTS`, adding support for key with multiple values in `process_opts()` fixes: scylladb#540 closes: scylladb#541
This mini-series implements two fixes for handling
SCYLLA_EXT_OPTS
:-c
and-m
options which are abbreviations for the--smp
and--memory
options and handles them correctly.--experimental-features
with correct handling.The individual issues:
#539 and #540 describes the specific problems.