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

microceph pool set-rf aggressively sets the default OSD pool size. #420

Open
masnax opened this issue Sep 12, 2024 · 1 comment
Open

microceph pool set-rf aggressively sets the default OSD pool size. #420

masnax opened this issue Sep 12, 2024 · 1 comment

Comments

@masnax
Copy link
Contributor

masnax commented Sep 12, 2024

This command takes a list of pool names as arguments, and a --size flag which accepts an integer for the pool size.

However, behind the scenes, this command also updates the default pool size along with the specified pools. This means if you want to just change 1 pool's size, you have to call the command twice, once with the pool name in question, and then once again with no pool name and the old default pool size to reset it.

Instead, we can add a flag --set-default which acts as a true/false query parameter on the API itself, determining whether the user wants to set the default OSD pool size or not.

Assuming the user wants to set a pool size of 1, we should still ensure that mon_allow_pool_size_one is set, even when not changing the default pool size.

This will also help with this case in the test suite:

 sudo microceph pool set-rf --size 1 ""

where an explicit empty string needs to be passed to set the default pool size without changing any pools. Instead, we can validate that if --set-default is given, the minimum argument length is actually 0.

@masnax
Copy link
Contributor Author

masnax commented Sep 12, 2024

The empty string case is accommodated in the API handlers as well with this block, which feels hacky. With the query parameter, this would not be necessary:

pool = strings.TrimSpace(pool)
if pool == "" {
continue
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant