Repository navigation
mgr/volumes: accept unit with subvolume resize - #62342
Conversation
|
@neesingh-rh @ceph/cephfs RFR |
neesingh-rh
left a comment
There was a problem hiding this comment.
The patch looks good. Will approve once I test it locally.
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
last push - no code change, resolved conflicts with a rebase |
|
why is "Check for missing .qa links / Check for missing .qa links" failing? I dont think there is any missing .qa link |
|
@neesingh-rh RFR |
|
bumping up this PR, RFR @ceph/cephfs |
|
jenkins test make check |
Wrong button during review, will continue and re-review.
| """ | ||
| invalid_values = ("10A", "1y00Ki", "af00", "G", "", " ", "-1t", "-1", | ||
| "1GT", "2MM", "5Di", "8Bi", "i", "7iB", ".10.G", | ||
| "10Ki.B", "20G/.", "Gi32Ki") |
There was a problem hiding this comment.
1.K as a value passes but should fail.
ceph fs subvolume resize cephfs sv1 1.K
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
[
{
"bytes_used": 0
},
{
"bytes_quota": 1024
},
{
"bytes_pcent": "0.00"
}
]
Can you double check all types of invalid_values we ironed out here are included:
https://github.com/ceph/ceph/pull/58962/files#diff-7f7425997b0e903d49a6e867b5cbcc42a0c54a56804fe27edfd692ba60cf98d7R197
There was a problem hiding this comment.
thanks for the review and finding this error :), the regex had a mistake which used to consider N. values. I've fixed the regex and tested it out locally. On top of it your review also helped me figure out one more issue - the incapability of my code to handle byte values (i.e. B as suffix) but now with the latest push i've patched it too. I've also added more cases in the test case you pointed out https://github.com/ceph/ceph/compare/5b5830b819b28d1d2cfa5136a616719bd089fc3e..058c87deae23ca136eb51e885e9cc2739da55f15
log excerpts from a local run:
2025-05-16 16:27:12,633.633 INFO:tasks.vstart_runner:> ./bin/ceph fs subvolume resize cephfs subvol7520 1.K
Error EINVAL: invalid size option '1.k'
Invalid bytes related cases:
2025-05-16 16:27:14,446.446 INFO:tasks.vstart_runner:> ./bin/ceph fs subvolume resize cephfs subvol7520 10.64B
Error EINVAL: Invalid byte value : 10.64
2025-05-16 16:27:14,699.699 INFO:tasks.vstart_runner:> ./bin/ceph fs subvolume resize cephfs subvol7520 1.B
Error EINVAL: invalid size option '1.b'
2025-05-16 16:27:14,957.957 INFO:tasks.vstart_runner:> ./bin/ceph fs subvolume resize cephfs subvol7520 .B
Error EINVAL: invalid size option '.b'
2025-05-16 16:27:15,222.222 INFO:tasks.vstart_runner:> ./bin/ceph fs subvolume resize cephfs subvol7520 B.1.
Error EINVAL: invalid size option 'b.1'
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
@vshankar ready to be tested |
I will only be able to get to this next week. |
|
@rishabh-d-dave PTAL |
rishabh-d-dave
left a comment
There was a problem hiding this comment.
Looks good. Left few nits.
| if multiplier is not None: | ||
| return float(value) * multiplier | ||
| else: | ||
| raise VolumeException(-errno.EINVAL, | ||
| f"Invalid subvolume unit: {unit}") |
There was a problem hiding this comment.
| if multiplier is not None: | |
| return float(value) * multiplier | |
| else: | |
| raise VolumeException(-errno.EINVAL, | |
| f"Invalid subvolume unit: {unit}") | |
| if multiplier is None: | |
| raise VolumeException(-errno.EINVAL, | |
| f"Invalid subvolume unit: {unit}") | |
| else: | |
| return float(value) * multiplier |
There was a problem hiding this comment.
both are equally readable IMO but i guess the if block is simpler to read, i'll push the change.
| @@ -371,7 +371,37 @@ def set_attrs(self, path, attrs): | |||
| raise VolumeException(-errno.EINVAL, | |||
| "invalid fscrypt_file specified: '{0}'".format(fscrypt_file)) | |||
|
|
|||
| def separate_unit_suffix(self, subvol_size): | |||
There was a problem hiding this comment.
Rename method name to something more suitable?
| def separate_unit_suffix(self, subvol_size): | |
| def conv_to_bytes(self, subvol_size): |
There was a problem hiding this comment.
changing to convert_to_bytes()
| with self.assertRaises(CommandFailedError): | ||
| self._fs_cmd("subvolume", "resize", self.volname, subvolume, | ||
| invalid_value) |
There was a problem hiding this comment.
Let's check the error message to. It's convenient to do so using negtest_ceph_cmd() method.
There was a problem hiding this comment.
I feel checking errno is enough here, if there is no hard need i'd prefer keeping this. wdyt?
| else: | ||
| return None |
There was a problem hiding this comment.
I believe it's impossible for execution to reach here, so this can be removed.
There was a problem hiding this comment.
for very weird inputs like Ki10 or something there will be no match. check test_subvolume_resize_invalid_unit().
f9afe76 to
9f9db02
Compare
|
last push was just a rebase |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
Specifying the quota or resize for a subvolume requires the value in bytes. This value can now be accepted as <num><unit>. Also allows floating point numbers. Fixes: https://tracker.ceph.com/issues/62673 Signed-off-by: Dhairya Parmar <[email protected]>
Signed-off-by: Dhairya Parmar <[email protected]>
|
@vshankar please include this in the next batch. |
|
@vshankar ping |
Deferring this to @chrisphoffman |
|
@chrisphoffman ping |
1 similar comment
|
@chrisphoffman ping |
|
This PR has been added to main integration testing by choffman started 2026-07-15-15:47. |
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition