From 4aaa59166b46a043daa382fa7ad8037fcc771414 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Mon, 16 Aug 2021 10:50:48 +0530 Subject: [PATCH] mgr/nfs: Add more debug log messages Fixes: https://tracker.ceph.com/issues/52274 Signed-off-by: Varsha Rao (cherry picked from commit 719e7024682d64da9bb2c22b90725ff311e83860) --- src/pybind/mgr/nfs/cluster.py | 3 +++ src/pybind/mgr/nfs/export.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/nfs/cluster.py b/src/pybind/mgr/nfs/cluster.py index ba642e427bb2d..4211bc6760c87 100644 --- a/src/pybind/mgr/nfs/cluster.py +++ b/src/pybind/mgr/nfs/cluster.py @@ -41,6 +41,7 @@ def create_ganesha_pool(mgr: 'MgrModule') -> None: mgr.check_mon_command({'prefix': 'osd pool application enable', 'pool': POOL_NAME, 'app': 'nfs'}) + log.debug("Successfully created nfs-ganesha pool %s", POOL_NAME) class NFSCluster: @@ -86,6 +87,7 @@ class NFSCluster: port=port) completion = self.mgr.apply_nfs(spec) orchestrator.raise_if_exception(completion) + log.debug("Successfully deployed nfs daemons with cluster id %s and placement %s", cluster_id, placement) def create_empty_rados_obj(self, cluster_id: str) -> None: common_conf = self._get_common_conf_obj_name(cluster_id) @@ -205,6 +207,7 @@ class NFSCluster: r['port'] = i.ports[0] if len(i.ports) > 1: r['monitor_port'] = i.ports[1] + log.debug("Successfully fetched %s info: %s", cluster_id, r) return r def show_nfs_cluster_info(self, cluster_id: Optional[str] = None) -> Tuple[int, str, str]: diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index 8237c71bf4ad8..6f84e35672011 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -214,6 +214,7 @@ class ExportMgr: fsal.cephx_key = self._create_user_key( export.cluster_id, fsal.user_id, export.path, fsal.fs_name, not rw ) + log.debug("Successfully created user %s for cephfs path %s", fsal.user_id, export.path) elif isinstance(export.fsal, RGWFSAL): rgwfsal = cast(RGWFSAL, export.fsal) @@ -236,6 +237,7 @@ class ExportMgr: # FIXME: make this more tolerate of unexpected output? rgwfsal.access_key_id = j['keys'][0]['access_key'] rgwfsal.secret_access_key = j['keys'][0]['secret_key'] + log.debug("Successfully fetched user %s for RGW path %s", rgwfsal.user_id, export.path) def _gen_export_id(self, cluster_id: str) -> int: exports = sorted([ex.export_id for ex in self.exports[cluster_id]]) @@ -290,6 +292,7 @@ class ExportMgr: self._delete_export_user(export) if not self.exports[cluster_id]: del self.exports[cluster_id] + log.debug("Deleted all exports for cluster %s", cluster_id) return 0, "Successfully deleted export", "" return 0, "", "Export does not exist" except Exception as e: @@ -566,6 +569,7 @@ class ExportMgr: ex_dict["cluster_id"] = cluster_id export = Export.from_dict(ex_id, ex_dict) export.validate(self.mgr) + log.debug("Successfully created %s export-%s from dict for cluster %s", fsal_type, ex_id, cluster_id) return export def create_cephfs_export(self, @@ -672,7 +676,8 @@ class ExportMgr: # re-fetch via old pseudo old_export = self._fetch_export(cluster_id, old_export.pseudo) assert old_export - self.mgr.log.debug(f"export {old_export.export_id} pseudo {old_export.pseudo} -> {new_export_dict['pseudo']}") + log.debug("export %s pseudo %s -> %s", + old_export.export_id, old_export.pseudo, new_export_dict['pseudo']) new_export = self.create_export_from_dict( cluster_id, -- 2.39.5