Skip to content

tentacle: mgr/nfs: reuse CephfsClient for path checks and earmark resolver - #72293

Open
ShwetaBhosale1 wants to merge 1 commit into
ceph:tentaclefrom
ShwetaBhosale1:wip-81287-tentacle
Open

ShwetaBhosale1 wants to merge 1 commit into
ceph:tentaclefrom
ShwetaBhosale1:wip-81287-tentacle

Conversation

@ShwetaBhosale1

Copy link
Copy Markdown
Contributor

cephfs_path_is_dir defined an inner function decorated with lru_cache, so
each call got a new function object and an empty cache, CephfsClient(mgr)
ran every time. Moved caching to module-level cephfs_client_for_mgr(mgr)
and call it from cephfs_path_is_dir.
Passed that shared client into CephFSEarmarkResolver from the NFS module so
export create/apply does not construct a separate CephfsClient for
earmarks.

Fixes: https://tracker.ceph.com/issues/76504
Signed-off-by: Shweta Bhosale <[email protected]>
(cherry picked from commit a32fe1e)

 Conflicts:
	src/pybind/mgr/nfs/module.py - due to qos related changes which are in umbrella
	src/pybind/mgr/nfs/tests/test_nfs.py - due to qos related import  which	are in umbrella

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ceph Release Engineering Audit Report

Commit Parity Visualizer

BACKPORT PR #72293 SOURCE PR SOURCE STATUS
a212024 mgr/nfs: reuse CephfsClient for path checks and earmark resolver PR #68842 a32fe1e mgr/nfs: reuse CephfsClient for path checks and earmark resolver

Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations

⚠️ WARNING: Cherry-pick conflicts or deviations were found that require component lead review.

A conflict or deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.

This does not necessarily indicate an issue but a maintainer should review.

**Click to expand conflict summaries.**

Deviation in Backport a212024 (cherry-pick of a32fe1e)

Affected File(s)

Range Diff

Click to expand
--- Original (a32fe1e8)
+++ Backport (a2120246)
@@ -10,3 +10,8 @@
 
 Fixes: https://tracker.ceph.com/issues/76504
 Signed-off-by: Shweta Bhosale <[email protected]>
+(cherry picked from commit a32fe1e8e0ef95f42a4b3f67baae56296d105964)
+
+ Conflicts:
+	src/pybind/mgr/nfs/module.py - due to qos related changes which are in umbrella
+	src/pybind/mgr/nfs/tests/test_nfs.py - due to qos related import  which	are in umbrella

================================================================================
RANGE DIFF
================================================================================

1:  a32fe1e8e0e ! 1:  a2120246619 mgr/nfs: reuse CephfsClient for path checks and earmark resolver
    @@ Commit message
     
         Fixes: https://tracker.ceph.com/issues/76504
         Signed-off-by: Shweta Bhosale <[email protected]>
    +    (cherry picked from commit a32fe1e8e0ef95f42a4b3f67baae56296d105964)
    +
    +     Conflicts:
    +            src/pybind/mgr/nfs/module.py - due to qos related changes which are in umbrella
    +            src/pybind/mgr/nfs/tests/test_nfs.py - due to qos related import  which are in umbrella
     
      ## src/pybind/mgr/nfs/module.py ##
     @@ src/pybind/mgr/nfs/module.py: from mgr_util import CephFSEarmarkResolver
    @@ src/pybind/mgr/nfs/module.py: from mgr_util import CephFSEarmarkResolver
      from .cluster import NFSCluster
     -from .utils import available_clusters
     +from .utils import available_clusters, cephfs_client_for_mgr
    - from .qos_conf import QOSType, QOSBandwidthControl, UserQoSType, QOSOpsControl
      
      log = logging.getLogger(__name__)
    + 
     @@ src/pybind/mgr/nfs/module.py: class Module(orchestrator.OrchestratorClientMixin, MgrModule):
    +             cmount_path: Optional[str] = "/"
          ) -> Dict[str, Any]:
              """Create a CephFS export"""
    -         self.export_mgr.skip_notify_nfs_server = skip_notify_nfs_server
     -        earmark_resolver = CephFSEarmarkResolver(self)
     +        earmark_resolver = CephFSEarmarkResolver(
     +            self, client=cephfs_client_for_mgr(self))
    @@ src/pybind/mgr/nfs/module.py: class Module(orchestrator.OrchestratorClientMixin,
                  fsal_type='cephfs',
                  fs_name=fsname,
     @@ src/pybind/mgr/nfs/module.py: class Module(orchestrator.OrchestratorClientMixin, MgrModule):
    -                               cluster_id: str,
    -                               inbuf: str,
    -                               skip_notify_nfs_server: bool = False) -> AppliedExportResults:
    +     @CLICheckNonemptyFileInput(desc='Export JSON or Ganesha EXPORT specification')
    +     @object_format.Responder()
    +     def _cmd_nfs_export_apply(self, cluster_id: str, inbuf: str) -> AppliedExportResults:
     -        earmark_resolver = CephFSEarmarkResolver(self)
              """Create or update an export by `-i <json_or_ganesha_export_file>`"""
     +        earmark_resolver = CephFSEarmarkResolver(
     +            self, client=cephfs_client_for_mgr(self))
    -         self.export_mgr.skip_notify_nfs_server = skip_notify_nfs_server
              return self.export_mgr.apply_export(cluster_id, export_config=inbuf,
                                                  earmark_resolver=earmark_resolver)
    + 
     @@ src/pybind/mgr/nfs/module.py: class Module(orchestrator.OrchestratorClientMixin, MgrModule):
      
          def export_apply(self, cluster_id: str, export_config: str) -> AppliedExportResults:
    @@ src/pybind/mgr/nfs/tests/test_nfs.py: from typing import Optional, Tuple, Iterat
      
      from rados import ObjectNotFound
     @@ src/pybind/mgr/nfs/tests/test_nfs.py: from ceph.deployment.service_spec import NFSServiceSpec
    - from ceph.utils import with_units_to_int, bytes_to_human
      from nfs import Module
      from nfs.export import ExportMgr, normalize_path
    + from nfs.ganesha_conf import GaneshaConfParser, Export, RawBlock
     +from nfs.utils import cephfs_client_for_mgr
    - from nfs.ganesha_conf import GaneshaConfParser, Export
    - from nfs.qos_conf import (
    -     RawBlock,
    + from nfs.cluster import NFSCluster
    + from orchestrator import ServiceDescription, DaemonDescription, OrchResult
    + 
     @@ src/pybind/mgr/nfs/tests/test_nfs.py: def test_ganesha_validate_access_type():
              _validate_access_type(ok)
          with pytest.raises(NFSInvalidOperation):

How to proceed:

  • Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git Conflicts: block intact) and include an explanation for changes.
  • Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
  • Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting /audit override.

Be familiar with the rules and guidelines for writing backports.


🛟 Need Help?

If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.

📋 Component Lead / Release Manager

To override the audit failure, apply releng-audit-override label or comment /audit override.


⚠️ Note: Automated audit checks will be suspended on future pushes to prevent comment spam while you work.

When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.

View workflow run

@github-actions github-actions Bot added the releng-audit-fail Release engineering: failed backport verification audit. label Oct 1, 2026
@IanEff IanEff mentioned this pull request Oct 2, 2026
2 of 6 tasks
@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath7-testing-20261109.045335-tentacle.

@JonBailey1993

Copy link
Copy Markdown
Contributor

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

Labels

core needs-qa nfs pybind releng-audit-fail Release engineering: failed backport verification audit. wip-bharath7-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants