Skip to content

Comments

client,mds: case-insensitive directory trees#60746

Merged
batrick merged 59 commits intoceph:mainfrom
batrick:i66373-wip
Mar 3, 2025
Merged

client,mds: case-insensitive directory trees#60746
batrick merged 59 commits intoceph:mainfrom
batrick:i66373-wip

Conversation

@batrick
Copy link
Member

@batrick batrick commented Nov 15, 2024

This is the PR of the case-insensitive tree work in CephFS. Comments welcome.

TODO:

  • resolve remaining TODO/FIXME in patches

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
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@batrick
Copy link
Member Author

batrick commented Nov 15, 2024

I'm aware there are some clang build failures. Will address tomorrow.

@ceph ceph deleted a comment from github-actions bot Dec 18, 2024
@ceph ceph deleted a comment from github-actions bot Dec 18, 2024
@batrick batrick marked this pull request as ready for review January 3, 2025 21:20
@batrick batrick requested a review from a team as a code owner January 3, 2025 21:20
@batrick batrick removed the DNM label Jan 3, 2025
@batrick batrick changed the title [WIP] mds: case-insensitive directory trees client,mds: case-insensitive directory trees Jan 3, 2025
@batrick batrick force-pushed the i66373-wip branch 2 times, most recently from 6f9e321 to fc5ff2e Compare January 6, 2025 15:27
@adamemerson adamemerson self-assigned this Jan 6, 2025
@batrick batrick force-pushed the i66373-wip branch 5 times, most recently from 5a78761 to 3b7e55e Compare January 6, 2025 19:40
@batrick
Copy link
Member Author

batrick commented Jan 7, 2025

This acquires a lock which is a no-no in the messenger.

Signed-off-by: Patrick Donnelly <[email protected]>
Many dispatchers return false to allow other dispatchers also common messages
like MOSDMap or MFSMap. They implicitly depend on some dispatcher which is
always at the "tail" of the dispatcher queue to return "true" indicating the
msg was processed to avoid messages like:

    2025-02-18T05:31:17.738+0000 7f5206546640  0 ms_deliver_dispatch: unhandled message 0x5632d05f0700 fsmap(e 9) from mon.0 v2:172.21.3.230:40412/0

but this cannot always happen when some libraries like the RadosClient used standalone.

So, add a variant for encapsulating other indications for how the message was
processed by dispatch2.  For example, a message may be "acknowledged" but
explicitly allow other dispatchers to try processing the message.

Note: we're using a variant to avoid updating all of the ms_dispatch code to
use the sentinel classes.

Signed-off-by: Patrick Donnelly <[email protected]>
Ancillary change: do not do client upkeep after map processing.

Signed-off-by: Patrick Donnelly <[email protected]>
Convert ms_dispatch to ms_dispatch2 to enable indicating that a map message is
acknowledged and instead of processed (or deliberately not processed).

Signed-off-by: Patrick Donnelly <[email protected]>
This avoids messages like:

    2025-02-18T05:31:17.738+0000 7f5206546640  0 ms_deliver_dispatch: unhandled message 0x5632d05f0700 fsmap(e 9) from mon.0 v2:172.21.3.230:40412/0

Signed-off-by: Patrick Donnelly <[email protected]>
Instead of marking the message as handled, give another component (or Client) a
chance to process.

Signed-off-by: Patrick Donnelly <[email protected]>
@batrick
Copy link
Member Author

batrick commented Feb 28, 2025

@batrick
Copy link
Member Author

batrick commented Feb 28, 2025

jenkins test api

@github-project-automation github-project-automation bot moved this from New to Reviewer approved in Ceph-Dashboard Mar 3, 2025
@vshankar
Copy link
Contributor

vshankar commented Mar 3, 2025

Approved on the basic of QA runs (mostly) and implementation which I went through a while back. This is good to merge.

@batrick
Copy link
Member Author

batrick commented Mar 3, 2025

Approved on the basic of QA runs (mostly) and implementation which I went through a while back. This is good to merge.

Thanks Venky!

@batrick batrick merged commit 048fc68 into ceph:main Mar 3, 2025
11 of 13 checks passed
@batrick batrick deleted the i66373-wip branch March 3, 2025 13:31
@github-project-automation github-project-automation bot moved this from Reviewer approved to Done in Ceph-Dashboard Mar 3, 2025

if(WITH_LIBCEPHFS)
find_package(ICU REQUIRED COMPONENTS uc i18n)
list(APPEND BOOST_COMPONENTS locale)
Copy link
Contributor

Choose a reason for hiding this comment

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

the client target depends on Boost::locale, but is not conditional on WITH_LIBCEPHFS. i raised #62108 to fix compilation when WITH_LIBCEPHFS=OFF

Comment on lines +2319 to +2320
with nogil:
ret = ceph_mds_command2(self.cluster, _mds_spec,
Copy link
Contributor

@cbodley cbodley Mar 4, 2025

Choose a reason for hiding this comment

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

any idea why this doesn't build on fedora with python 3.13?

performance hint: cephfs.pyx:114:5: Exception check on 'completion_callback' will always require the GIL to be acquired.       
Possible solutions:                   
        1. Declare 'completion_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
        2. Use an 'int' return type on 'completion_callback' to allow an error code to be returned.

Error compiling Cython file:
------------------------------------------------------------
...
            with nogil:
                ret = ceph_mds_command2(self.cluster, _mds_spec,
                                        <const char **>_cmd, _cmdlen,
                                        <const char*>_inbuf, _inbuf_len,
                                        _one_shot,
                                        completion_callback,
                                        ^
------------------------------------------------------------

cephfs.pyx:2324:40: Cannot assign type 'void (int, const void *, size_t, const void *, size_t, void *) except * nogil' to 'libcephfs_c_completion_t' (alias of 'void (*)(int, const void *, size_t, const void *, size_t, void *) noexcept nogil'). Exception values are incompatible. Suggest adding 'noexcept' to the type of 'completion_callback'.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cython version perhaps. See: #62099

Copy link
Member Author

Choose a reason for hiding this comment

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

@cbodley can you please try #62107

anoopcs9 added a commit to anoopcs9/ceph that referenced this pull request Mar 20, 2025
man fchownat(2)[1] says the following:
. . .
AT_EMPTY_PATH (since Linux 2.6.39)
    If pathname is an empty string, operate on the file referred to by
    dirfd (which may have been obtained using the open(2) O_PATH flag).
    In this case, dirfd can refer to any type of file, not just a
    directory. If dirfd is AT_FDCWD, the call operates on the current
    working directory.
. . .

Look out for an empty pathname and use the relative fd's inode in the
presence of AT_EMPTY_PATH flag before calling internal _setattr().

Fixes: https://tracker.ceph.com/issues/68189

Review with: git show -w

Note: path_walk() refactor from ceph#60746
incorporates the core changes required here and thus src/libcephfs.cc
changes have been removed from the cherry-pick as they conflict at the
same time.

[1] https://www.man7.org/linux/man-pages/man2/fchownat.2.html

Signed-off-by: Anoop C S <[email protected]>
(cherry picked from commit 829f388)
anoopcs9 added a commit to anoopcs9/ceph that referenced this pull request Mar 20, 2025
man statx(2)[1] says the following:
. . .
AT_EMPTY_PATH
    If pathname is an empty string, operate on the file referred to by
    dirfd (which may have been obtained using the open(2) O_PATH flag).
    In this case, dirfd can refer to any type of file, not just a
    directory.

    If dirfd is AT_FDCWD, the call operates on the current working
    directory.
. . .

Look out for an empty pathname and use the relative fd's inode in the
presence of AT_EMPTY_PATH flag before calling internal _getattr().

Fixes: https://tracker.ceph.com/issues/68189

Review with: git show -w

Note: path_walk() refactor from ceph#60746
incorporates the core changes required here and thus src/libcephfs.cc
changes have been removed from the cherry-pick as they conflict at the
same time.

[1] https://www.man7.org/linux/man-pages/man2/statx.2.html

Signed-off-by: Anoop C S <[email protected]>
(cherry picked from commit edd7fe7)
anoopcs9 added a commit to anoopcs9/ceph that referenced this pull request Mar 20, 2025
man fchownat(2)[1] says the following:
. . .
AT_EMPTY_PATH (since Linux 2.6.39)
    If pathname is an empty string, operate on the file referred to by
    dirfd (which may have been obtained using the open(2) O_PATH flag).
    In this case, dirfd can refer to any type of file, not just a
    directory. If dirfd is AT_FDCWD, the call operates on the current
    working directory.
. . .

Look out for an empty pathname and use the relative fd's inode in the
presence of AT_EMPTY_PATH flag before calling internal _setattr().

Fixes: https://tracker.ceph.com/issues/68189

Review with: git show -w

Note: path_walk() refactor from ceph#60746
included the core changes required here and thus src/client/Client.cc
changes have been removed from the cherry-pick as they conflict at the
same time.

[1] https://www.man7.org/linux/man-pages/man2/fchownat.2.html

Signed-off-by: Anoop C S <[email protected]>
(cherry picked from commit 829f388)
anoopcs9 added a commit to anoopcs9/ceph that referenced this pull request Mar 20, 2025
man statx(2)[1] says the following:
. . .
AT_EMPTY_PATH
    If pathname is an empty string, operate on the file referred to by
    dirfd (which may have been obtained using the open(2) O_PATH flag).
    In this case, dirfd can refer to any type of file, not just a
    directory.

    If dirfd is AT_FDCWD, the call operates on the current working
    directory.
. . .

Look out for an empty pathname and use the relative fd's inode in the
presence of AT_EMPTY_PATH flag before calling internal _getattr().

Fixes: https://tracker.ceph.com/issues/68189

Review with: git show -w

Note: path_walk() refactor from ceph#60746
included the core changes required here and thus src/client/Client.cc
changes have been removed from the cherry-pick as they conflict at the
same time.

[1] https://www.man7.org/linux/man-pages/man2/statx.2.html

Signed-off-by: Anoop C S <[email protected]>
(cherry picked from commit edd7fe7)
@spuiuk spuiuk removed the wip-spuiuk-tracking Sachin Prabhu - tracking label Aug 21, 2025
Comment on lines +232 to +234
if (struct_v >= 8) {
decode(optmetadata, p);
}
Copy link
Contributor

@mchangir mchangir Sep 9, 2025

Choose a reason for hiding this comment

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

@batrick now that the struct version is bumped up to 8, shouldn't the decode macro at the top also reflect the bumped up version, i.e. DECODE_START(8, p);

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I think so. In this case it's a harmless omission because the compatv did not increase.

Since you found it, would you like to make the change?

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.