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

scylla_raid_setup: --online-discard option always enables 'discard' #14963

Closed
vladzcloudius opened this issue Aug 4, 2023 · 9 comments
Closed
Assignees
Labels
Field-Tier1 Urgent issues as per FieldEngineering request
Milestone

Comments

@vladzcloudius
Copy link
Contributor

Installation details
HEAD: Scylla version (or git commit hash):

Description
scylla_raid_setup will always enable discard mount option even if --online-discard False is given.

Root cause
argparse doesn't support boolean parameter.
To encode such values one should either use action='store_true' (preferred way) or decode the string value using distutils.util.strtobool(value)

Unless action='store_true' is used (which is not the case) the if args.online_discard is going to give an unexpected result - it will be True when the value is set (to any value - which happens to be always the case since the default is provided as well).

While the code that has the condition above assumes that it checks the actual value of the variable.

@vladzcloudius
Copy link
Contributor Author

cc @roydahan @avikivity
Missing/bogus test alert.

vladzcloudius added a commit to vladzcloudius/scylla that referenced this issue Aug 5, 2023
This argument was dead since its introduction and 'discard' was
always configured regardless of its value.
This patch allows actually configuring things using this argument.

Fixes scylladb#14963
@vladzcloudius
Copy link
Contributor Author

@mykaul mykaul changed the title scylla_raid_setup: --online-discard option implementation is broken and effectvely always enabled 'discard' scylla_raid_setup: --online-discard option always enabled 'discard' Aug 6, 2023
@mykaul
Copy link
Contributor

mykaul commented Aug 6, 2023

I did not read the code, so just asking - if you don't want this enabled, wouldn't it be simpler not to pass '--online-discard' ? (or is the default true, so effectively you can't disable it?)

@vladzcloudius
Copy link
Contributor Author

vladzcloudius commented Aug 7, 2023

I did not read the code, so just asking - if you don't want this enabled, wouldn't it be simpler not to pass '--online-discard' ? (or is the default true, so effectively you can't disable it?)

@mykaul
If you don't pass --online-discard today the idea of the author (@avikivity) was to have the option enabled. And this GH issue is not about changing the current semantics (as much as I hate it and disagree with it).

And that was the only thing that the author tested apparently before sending the patch that added this patch (a19d00e) - the default works as expected ;)

This issue is about the fact that the non-default (when you give --online-discard false) doesn't work. And as far as I can tell - it never worked.

So, let's fix this ASAP and backport to all our currently supported official releases.

The PR with the fix has been sent on Friday (3 days ago).

@roydahan
Copy link

roydahan commented Aug 8, 2023

I vaguely recall a long discussion about this without reaching agreement on the test / behavior or even the necessity of this option.
IIRC, @soyacz was involved in this. Do you recall that issue?

@soyacz
Copy link
Contributor

soyacz commented Aug 8, 2023

@roydahan I don't think it was me or you mixed with scylladb/scylla-machine-image#394

@roydahan
Copy link

roydahan commented Aug 9, 2023

@roydahan I don't think it was me or you mixed with scylladb/scylla-machine-image#394

Yes, you're right, I mixed it with it.

@vladzcloudius vladzcloudius added the Field-Tier1 Urgent issues as per FieldEngineering request label Aug 9, 2023
@vladzcloudius vladzcloudius changed the title scylla_raid_setup: --online-discard option always enabled 'discard' scylla_raid_setup: --online-discard option always enables 'discard' Aug 9, 2023
@DoronArazii DoronArazii added this to the 5.4 milestone Aug 9, 2023
@DoronArazii
Copy link

@scylladb/scylla-maint please consider backporting all the way to 2022.1

@DoronArazii DoronArazii added backport/5.2 Issues that should be backported to 5.2 branch once they'll be fixed Requires-Backport-to-5.1 labels Aug 22, 2023
denesb pushed a commit that referenced this issue Aug 22, 2023
This argument was dead since its introduction and 'discard' was
always configured regardless of its value.
This patch allows actually configuring things using this argument.

Fixes #14963

Closes #14964

(cherry picked from commit e13a2b6)
denesb pushed a commit that referenced this issue Aug 22, 2023
This argument was dead since its introduction and 'discard' was
always configured regardless of its value.
This patch allows actually configuring things using this argument.

Fixes #14963

Closes #14964

(cherry picked from commit e13a2b6)
@denesb
Copy link
Contributor

denesb commented Aug 22, 2023

Backported to 5.2, 5.1 and 2022.1.

@denesb denesb removed Backport candidate backport/5.2 Issues that should be backported to 5.2 branch once they'll be fixed Requires-Backport-to-5.1 labels Aug 22, 2023
raphaelsc pushed a commit to raphaelsc/scylla that referenced this issue Aug 22, 2023
This argument was dead since its introduction and 'discard' was
always configured regardless of its value.
This patch allows actually configuring things using this argument.

Fixes scylladb#14963

Closes scylladb#14964
raphaelsc pushed a commit to raphaelsc/scylla that referenced this issue Aug 29, 2023
This argument was dead since its introduction and 'discard' was
always configured regardless of its value.
This patch allows actually configuring things using this argument.

Fixes scylladb#14963

Closes scylladb#14964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Field-Tier1 Urgent issues as per FieldEngineering request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants