Skip to content

Conversation

rawe0
Copy link
Member

@rawe0 rawe0 commented Jul 4, 2025

A proof of concept for the inode to path reverse resolution in the cephfs driver.

The main function is GetPathByID which does the following:

  1. Query the Ceph monitor and parse the active mds (getFSStatus() & parseActiveMDS())
  2. Convert the opaque_id to an integer (to be seen if needed in the future, for testing it was required)
  3. Query the Ceph MDS (Metadata Server) to "dump inode" to get the path (dumpInode() & extractPathFromInodeOutput())
  4. Trim the Reva mount path from the full path.

The path we get from the mds is the full path on the ceph cluster e.g. /volumes/_nogroup/rasmus/welander, however Reva mounts at the root /volumes/_nogroup/rasmus, so the corresponding cephfs driver path is /rasmus/welander.

Note: this proof of concept uses a powerful admin key to the ceph cluster, which will need to be generated for the production ceph cluster with the required permissions, and has only been tested on a test ceph cluster.

Line 215 - 224 should be removed since it's only there for testing purposes.

Copy link

update-docs bot commented Jul 4, 2025

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@rawe0
Copy link
Member Author

rawe0 commented Jul 4, 2025

I don't know why "github.com/rs/zerolog/log" is imported, however every time I try to save to file it adds it automatically, so not sure if I have done something wrong with the logging.

Copy link
Member

@glpatcern glpatcern left a comment

Choose a reason for hiding this comment

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

A first pass with some suggestions

@glpatcern glpatcern changed the title Proof of concept for inode to path reverse resolution in the cephfs driver feat: inode to path reverse resolution in the cephfs driver Jul 15, 2025
@rawe0 rawe0 force-pushed the ceph-inode-to-path-resolution branch 2 times, most recently from b01e033 to 5b8ba55 Compare July 17, 2025 14:20
@rawe0
Copy link
Member Author

rawe0 commented Jul 17, 2025

Keep in mind, for this to work on the production cluster, we will need a key that has access to these commands.

glpatcern
glpatcern previously approved these changes Jul 17, 2025
@glpatcern glpatcern marked this pull request as ready for review July 17, 2025 14:48
@glpatcern
Copy link
Member

OK, before merging: please add a changelog in /changelog/unreleased similar to others, and rebase on top of current master - that should be enough to pass the ceph tests

@rawe0 rawe0 force-pushed the ceph-inode-to-path-resolution branch 4 times, most recently from e8ebcc9 to 2a978f6 Compare July 17, 2025 16:03
@glpatcern glpatcern self-requested a review July 18, 2025 07:33
@glpatcern
Copy link
Member

As discussed, let's just include some logic to return Not Supported when the Ceph key is not "powerful enough" to make the command succeed. Then, this can be merged 👍

@rawe0 rawe0 force-pushed the ceph-inode-to-path-resolution branch 2 times, most recently from 31044cf to 295433b Compare July 18, 2025 14:29
@rawe0 rawe0 force-pushed the ceph-inode-to-path-resolution branch from 295433b to 922bc30 Compare July 18, 2025 15:21
@glpatcern glpatcern merged commit 21bf371 into master Jul 18, 2025
25 checks passed
@diocas diocas deleted the ceph-inode-to-path-resolution branch July 28, 2025 07:32
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

Successfully merging this pull request may close these issues.

2 participants