Skip to content

pybind/mgr/volumes: configure case sensitivity - #62105

Merged
avanthakkar merged 6 commits into
ceph:mainfrom
xhernandez:configure-case-sensitivity
Mar 27, 2025
Merged

avanthakkar merged 6 commits into
ceph:mainfrom
xhernandez:configure-case-sensitivity

Conversation

@xhernandez

Copy link
Copy Markdown
Contributor

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@github-actions github-actions Bot added cephfs Ceph File System pybind labels Mar 4, 2025
@avanthakkar
avanthakkar requested a review from a team March 4, 2025 16:30
Comment thread src/pybind/mgr/volumes/fs/volume.py Resolved
Comment thread src/pybind/mgr/volumes/fs/volume.py Resolved
Comment thread src/pybind/mgr/volumes/fs/volume.py Resolved
Comment thread src/pybind/mgr/volumes/module.py Resolved
Comment thread src/pybind/mgr/volumes/fs/volume.py Resolved
@avanthakkar

Copy link
Copy Markdown
Contributor

mypy failure in make check :

volumes/module.py:9: note: In module imported here,
volumes/__init__.py:2: note: ... from here:
volumes/fs/volume.py: note: In member "create_subvolume" of class "VolumeClient":
volumes/fs/volume.py:276: error: Name "casesensitive" is not defined  [name-defined]
Found 1 error in 1 file (checked 32 source files)

@avanthakkar avanthakkar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update qa suites too just like for earmarking

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you want to do this at subvolume creation time rather than add fix it in the second RPC ceph fs subvolume charmap ...?

@xhernandez

Copy link
Copy Markdown
Contributor Author

Is there a reason you want to do this at subvolume creation time rather than add fix it in the second RPC ceph fs subvolume charmap ...?

Initially I thought that doing something similar to earmarking would be ok. Then I realized that there exists this command and some internal helpers that could be used, but I didn't know how or from where to call them. Can you give me some hints about where to call this command when a samba share is created ?

@phlogistonjohn

phlogistonjohn commented Mar 13, 2025 •

Copy link
Copy Markdown
Contributor

Is there a reason you want to do this at subvolume creation time rather than add fix it in the second RPC ceph fs subvolume charmap ...?

I'll inject myself into this conversation to add my 2c:
There's a case for having all the major properties of a subvolume available at creation time for an admin to do create a subvolume for a specific purpose (smb shares) in one single action. CLI users get to avoid having to look up a 2nd command and there's no chance of the volume ever being in an in-between state.
In the case of UI the GUI can call a single backend API for all these properties.

PS. If we don't do this now I feel a PM I know will eventually ask for it ;-)

Re-reading my comment I don't think I was being particularly clear. The value of one RPC/API having this is (a) discoverability - when I look up the create subvolume command docs I see an option about setting case insentivity rather than having to look it up seperately and (b) no gaps - not creating the volume sharing it out in the "wrong" state and then needing to go back and change it later

@batrick

batrick commented Mar 17, 2025

Copy link
Copy Markdown
Member

Is there a reason you want to do this at subvolume creation time rather than add fix it in the second RPC ceph fs subvolume charmap ...?

Initially I thought that doing something similar to earmarking would be ok. Then I realized that there exists this command and some internal helpers that could be used, but I didn't know how or from where to call them. Can you give me some hints about where to call this command when a samba share is created ?

Well, I don't think there is a straightforward way to adapt the "charmap" commands to this particular flag you want to use. You just want a way to set casesensitive on a the subvolume so what you have is probably fine.

@batrick

batrick commented Mar 17, 2025

Copy link
Copy Markdown
Member

Is there a reason you want to do this at subvolume creation time rather than add fix it in the second RPC ceph fs subvolume charmap ...?

I'll inject myself into this conversation to add my 2c: There's a case for having all the major properties of a subvolume available at creation time for an admin to do create a subvolume for a specific purpose (smb shares) in one single action. CLI users get to avoid having to look up a 2nd command and there's no chance of the volume ever being in an in-between state. In the case of UI the GUI can call a single backend API for all these properties.

PS. If we don't do this now I feel a PM I know will eventually ask for it ;-)

Re-reading my comment I don't think I was being particularly clear. The value of one RPC/API having this is (a) discoverability - when I look up the create subvolume command docs I see an option about setting case insentivity rather than having to look it up seperately and (b) no gaps - not creating the volume sharing it out in the "wrong" state and then needing to go back and change it later

If you think there is a real danger of a subvolume being used in a "half-way" state, then this change is fine with me. I think however we should go ahead and add "normalization" now in addition to "casesensitive". "encoding" can be skipped.

@xhernandez
xhernandez force-pushed the configure-case-sensitivity branch from 4811ac6 to 7fcb5ab Compare March 19, 2025 12:28
@xhernandez

Copy link
Copy Markdown
Contributor Author

I've addressed the comments and also added a normalization option.

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the documentation too.

otherwise LGTM

@avanthakkar avanthakkar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Could you move it out of draft state? I've also triggered a shaman build for the changes. Once the image is ready, I'll test it locally and attempt to run teuthology as well.

@avanthakkar
avanthakkar dismissed their stale review March 20, 2025 15:17

comments are addressed

@avanthakkar

Copy link
Copy Markdown
Contributor

make check failure seems related:

flake8: commands[0] /home/jenkins-build/build/workspace/ceph-pull-requests/qa> flake8 --select=F,E9 --exclude=venv,.tox
./tasks/cephfs/test_volumes.py:2569:13: F841 local variable 'case_sensitive' is assigned to but never used
./tasks/cephfs/test_volumes.py:2612:13: F841 local variable 'normalization' is assigned to but never used
flake8: exit 1 (6.61 seconds) /home/jenkins-build/build/workspace/ceph-pull-requests/qa> flake8 --select=F,E9 --exclude=venv,.tox pid=3809804
flake8: FAIL ✖ in 10.36 seconds

Comment thread src/pybind/mgr/volumes/module.py Resolved
@xhernandez

Copy link
Copy Markdown
Contributor Author

I've updated the way the options are used:

There's an optional --normalization option that takes as an argument a unicode normalization form. There's also an optional --case_insensitive boolean option (instead of the original --case-sensitive <true|false>).

Using --case_insensitive also enables --normalization implicitly (this is inherited from the charset behavior).

With these two options we can define all possible configurations:

  • No normalization, case sensitive: This is the default, no option should be provided
  • Normalization, case sensitive: Only --normalization option is required
  • Normalization, case insensitive: --case_insensitive is enough, unless the default normalization is not what you want. In this case the --normalization option can also be specified.

@xhernandez
xhernandez force-pushed the configure-case-sensitivity branch 2 times, most recently from 7c21d28 to d974f89 Compare March 21, 2025 22:52
@xhernandez
xhernandez marked this pull request as ready for review March 22, 2025 07:16
@xhernandez
xhernandez requested a review from a team as a code owner March 22, 2025 07:16

@anoopcs9 anoopcs9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general the case insensitive option is still displayed and meant to be used as --case-sensitive and not --case_sensitive, right?

@avanthakkar

Copy link
Copy Markdown
Contributor

Teuthology failure :

2025-03-25T11:07:58.122 INFO:tasks.cephfs_test_runner:test_subvolume_create_with_normalization (tasks.cephfs.test_volumes.TestSubvolumes) ... ERROR
2025-03-25T11:07:58.122 INFO:tasks.cephfs_test_runner:
2025-03-25T11:07:58.122 INFO:tasks.cephfs_test_runner:======================================================================
2025-03-25T11:07:58.122 INFO:tasks.cephfs_test_runner:ERROR: test_subvolume_create_with_normalization (tasks.cephfs.test_volumes.TestSubvolumes)
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_ceph-c_15c6874445d8abf7144ed4b12e051bd3e1578f55/qa/tasks/cephfs/test_volumes.py", line 2712, in test_subvolume_create_with_normalization
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:    subvolpath = self._get_subvolume_path(self.volname, subvolume, "--normalization", "nfc")
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:TypeError: TestVolumesHelper._get_subvolume_path() takes from 3 to 4 positional arguments but 5 were given
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:Ran 96 tests in 4312.596s
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:FAILED (errors=1)
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:
2025-03-25T11:07:58.123 INFO:tasks.cephfs_test_runner:======================================================================
2025-03-25T11:07:58.124 INFO:tasks.cephfs_test_runner:ERROR: test_subvolume_create_with_normalization (tasks.cephfs.test_volumes.TestSubvolumes)
2025-03-25T11:07:58.124 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2025-03-25T11:07:58.124 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2025-03-25T11:07:58.124 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_ceph-c_15c6874445d8abf7144ed4b12e051bd3e1578f55/qa/tasks/cephfs/test_volumes.py", line 2712, in test_subvolume_create_with_normalization
2025-03-25T11:07:58.124 INFO:tasks.cephfs_test_runner:    subvolpath = self._get_subvolume_path(self.volname, subvolume, "--normalization", "nfc")
2025-03-25T11:07:58.124 INFO:tasks.cephfs_test_runner:TypeError: TestVolumesHelper._get_subvolume_path() takes from 3 to 4 positional arguments but 5 were given

https://pulpito.ceph.com/avan-2025-03-25_09:29:02-fs:volumes-wip-athakkar-testing-2025-03-25-1217-distro-default-smithi/

Comment thread qa/tasks/cephfs/test_volumes.py Resolved
When a new subvolume is created, optionally set the
ceph.dir.normalization xattr to the root directory.

Signed-off-by: Xavi Hernandez <[email protected]>
Add an option to explicitly set the unicode normalization form to use on
a CephFS subvolume.

Signed-off-by: Xavi Hernandez <[email protected]>
Add an option to explicitly set the case sensitivity of a CephFS
subvolume.

Signed-off-by: Xavi Hernandez <[email protected]>
@xhernandez
xhernandez force-pushed the configure-case-sensitivity branch from 2651412 to 0440009 Compare March 25, 2025 13:46
@xhernandez
xhernandez force-pushed the configure-case-sensitivity branch from 0440009 to d9704c0 Compare March 25, 2025 13:52
@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test api

@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test windows

@avanthakkar

Copy link
Copy Markdown
Contributor

@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test make check

4 similar comments
@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test make check

@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test make check

@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test make check

@avanthakkar

Copy link
Copy Markdown
Contributor

jenkins test make check

@avanthakkar
avanthakkar requested a review from anoopcs9 March 27, 2025 06:41

@anoopcs9 anoopcs9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@avanthakkar
avanthakkar merged commit 210a00a into ceph:main Mar 27, 2025
@xhernandez
xhernandez deleted the configure-case-sensitivity branch March 27, 2025 11:46
anoopcs9 added a commit to anoopcs9/sit-environment that referenced this pull request Mar 28, 2025
ceph/ceph#62105 is now merged which introduces
the '--case-insensitive' subvolume option to make it case insensitive
to suite SMB use cases.

Signed-off-by: Anoop C S <[email protected]>
anoopcs9 added a commit to anoopcs9/sit-environment that referenced this pull request Mar 28, 2025
ceph/ceph#62105 is now merged which introduces
the `--case-insensitive` subvolume option to make it case insensitive
to suite SMB use cases.

Signed-off-by: Anoop C S <[email protected]>
anoopcs9 added a commit to anoopcs9/sit-environment that referenced this pull request Mar 28, 2025
ceph/ceph#62105 is now merged which introduces
the `--case-insensitive` subvolume option to make it case insensitive
to suite SMB use cases.

Signed-off-by: Anoop C S <[email protected]>
anoopcs9 added a commit to anoopcs9/sit-environment that referenced this pull request Apr 2, 2025
ceph/ceph#62105 is now merged which introduces
the `--case-insensitive` subvolume option to make it case insensitive
to suite SMB use cases.

Signed-off-by: Anoop C S <[email protected]>
@batrick

batrick commented Apr 18, 2025

Copy link
Copy Markdown
Member

followup: #62872

@batrick

batrick commented Apr 28, 2025

Copy link
Copy Markdown
Member

backported to squid via #63023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants