Skip to content

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

batrick and others added 16 commits February 27, 2025 19:55
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
This C++ code was relying on the Client.h header to bring in these names from
the std:: namespace. A subsequent commit plans to remove that header so add
namespace qualifier now.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Linking to the client causes two copies of the Client library to be linked in
the ceph-mgr when modules also dynamically link to libcephfs via the "cephfs"
python library. This creates problems with duplicate boost::locale.

Instead, modules should just use the "cephfs" library to send commands to the
MDS.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
For use by MgrModule.send_command to signal MDS command completion.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
To avoid linking to the CephFS client statically, use the dynamically-linked
`cephfs` module to send commands to the MDS.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
This acquires a lock which is a no-no in the messenger.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
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 <pdonnell@ibm.com>
Ancillary change: do not do client upkeep after map processing.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
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 <pdonnell@ibm.com>
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 <pdonnell@ibm.com>
Instead of marking the message as handled, give another component (or Client) a
chance to process.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
@batrick
Copy link
Member Author

batrick commented Feb 28, 2025

Adding the QA test changes added for https://tracker.ceph.com/issues/70197#note-5

@batrick
Copy link
Member Author

batrick commented Feb 28, 2025

jenkins test api

@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!


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

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.