Repository navigation
tentacle: mgr/cephadm: During upgrade if NFS cluster is using old nodeids, keep using old node ids - #70283
tentacle: mgr/cephadm: During upgrade if NFS cluster is using old nodeids, keep using old node ids#70283ShwetaBhosale1 wants to merge 1 commit into
Conversation
d14b5d6 to
8c9c333
Compare
8c9c333 to
90c91e2
Compare
90c91e2 to
cdfecbc
Compare
|
@ShwetaBhosale1 this PR is part of the |
|
This PR has been added to wip-yuri13-testing-20260729.211123-tentacle. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
cdfecbc to
f51b06c
Compare
There was a problem hiding this comment.
Ceph Release Engineering Audit Report
Commit Parity Visualizer
| BACKPORT PR #70283 | SOURCE PR |
SOURCE STATUS |
|---|---|---|
| f51b06c mgr/cephadm: During upgrade if NFS cluster is using old nodeids, keep using it | PR #63617 | 12e2928 mgr/cephadm: During upgrade if NFS cluster is using old nodeids, keep using it |
Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations
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 f51b06c (cherry-pick of 12e2928)
Affected File(s)
src/pybind/mgr/cephadm/migrations.pysrc/pybind/mgr/cephadm/module.pysrc/pybind/mgr/cephadm/services/nfs.pysrc/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2src/pybind/mgr/cephadm/tests/services/test_ingress.py
Range Diff
Click to expand
--- Original (12e2928f)
+++ Backport (f51b06c2)
@@ -2,3 +2,11 @@
Fixes: https://tracker.ceph.com/issues/71509
Signed-off-by: Shweta Bhosale <[email protected]>
+(cherry picked from commit 12e2928f81b0cf61b4d6d4e59653b8e7e3dddfd5)
+
+Conflicts:
+ src/pybind/mgr/cephadm/migrations.py - due to LAST_MIGRATION change
+ src/pybind/mgr/cephadm/module.py - due to node id changes during nfs service removal
+ src/pybind/mgr/cephadm/services/nfs.py - due to nodeid logic, and nfs protocol field
+ src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 - removed TLS config
+ src/pybind/mgr/cephadm/tests/services/test_ingress.py - removed TLS related test cases
================================================================================
RANGE DIFF
================================================================================
1: 12e2928f81b ! 1: f51b06c27b1 mgr/cephadm: During upgrade if NFS cluster is using old nodeids, keep using it
@@ Commit message
Fixes: https://tracker.ceph.com/issues/71509
Signed-off-by: Shweta Bhosale <[email protected]>
+ (cherry picked from commit 12e2928f81b0cf61b4d6d4e59653b8e7e3dddfd5)
+
+ Conflicts:
+ src/pybind/mgr/cephadm/migrations.py - due to LAST_MIGRATION change
+ src/pybind/mgr/cephadm/module.py - due to node id changes during nfs service removal
+ src/pybind/mgr/cephadm/services/nfs.py - due to nodeid logic, and nfs protocol field
+ src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 - removed TLS config
+ src/pybind/mgr/cephadm/tests/services/test_ingress.py - removed TLS related test cases
## src/pybind/mgr/cephadm/migrations.py ##
@@
@@ src/pybind/mgr/cephadm/migrations.py
-from typing import TYPE_CHECKING, Iterator, Optional, Dict, Any, List
+from typing import TYPE_CHECKING, Iterator, Optional, Dict, Any, List, cast
--from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, HostPlacementSpec, RGWSpec, CertificateSource
-+from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, HostPlacementSpec, RGWSpec, CertificateSource, NFSServiceSpec
+-from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, HostPlacementSpec, RGWSpec
++from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, HostPlacementSpec, RGWSpec, NFSServiceSpec
from cephadm.schedule import HostAssignment
from cephadm.utils import SpecialHostLabels
+from cephadm.services.nfs import NFSService
+from cephadm.services.service_registry import service_registry
import rados
- from mgr_util import get_cert_issuer_info
+ from mgr_module import NFS_POOL_NAME
@@ src/pybind/mgr/cephadm/migrations.py: from orchestrator import OrchestratorError, DaemonDescription
if TYPE_CHECKING:
from .module import CephadmOrchestrator
--LAST_MIGRATION = 8
-+LAST_MIGRATION = 9
+-LAST_MIGRATION = 7
++LAST_MIGRATION = 8
logger = logging.getLogger(__name__)
@@ src/pybind/mgr/cephadm/migrations.py: class Migrations:
- if self.migrate_7_8():
- self.set(8)
+ if self.migrate_6_7():
+ self.set(7)
-+ if self.mgr.migration_current == 8 and not startup:
-+ logger.info('Running migration 8 -> 9')
-+ if self.migrate_8_9():
-+ self.set(9)
++ if self.mgr.migration_current == 7 and not startup:
++ logger.info('Running migration 7 -> 8')
++ if self.migrate_7_8():
++ self.set(8)
+
def migrate_0_1(self) -> bool:
"""
Migration 0 -> 1
@@ src/pybind/mgr/cephadm/migrations.py: class Migrations:
- logger.error(f"Promtail -> Alloy migration failed: {e}")
- return False
+ # was set to true. Therefore we have nothing to migrate for those daemons
+ return True
-+ def migrate_8_9(self) -> bool:
++ def migrate_7_8(self) -> bool:
+ # For NFS, check if nfs cluster is using old types of node ids (service_name.0)
+ # if yes, then store those daemons in mon store, to continue using old node ids for those daemons
+ nfs_services = []
@@ src/pybind/mgr/cephadm/migrations.py: class Migrations:
## src/pybind/mgr/cephadm/module.py ##
@@ src/pybind/mgr/cephadm/module.py: Then run the following:
- for h, ls in osds_msg.items():
msg += f'\thost {h}: {" ".join([f"osd.{id}" for id in ls])}'
raise OrchestratorError(
-- f'If {service_name} is removed then the following OSDs '
-- f'will remain, --force to proceed anyway\n{msg}'
-- )
-+ f'If {service_name} is removed then the following OSDs will remain, --force to proceed anyway\n{msg}')
+ f'If {service_name} is removed then the following OSDs will remain, --force to proceed anyway\n{msg}')
+ elif service_name.startswith('nfs.'):
+ # check if its using old node id style and remove from mon store
+ nfs_services = self.get_store('nfs_services_with_old_nodeid')
@@ src/pybind/mgr/cephadm/module.py: Then run the following:
+ val = ','.join(nfs_services) if nfs_services else None
+ self.set_store('nfs_services_with_old_nodeid', val)
- spec = self.spec_store[service_name].spec
- CephadmServe(self)._remove_service_config(spec)
+ found = self.spec_store.rm(service_name)
+ if found and service_name.startswith('osd.'):
## src/pybind/mgr/cephadm/services/nfs.py ##
@@ src/pybind/mgr/cephadm/services/nfs.py: class NFSService(CephService):
for daemon_id in m.values():
if daemon_id is not None:
self.fence(daemon_id)
+- del rank_map[rank]
- nodeid = f'{rank}'
+- self.mgr.log.info(f'Removing {nodeid} from the ganesha grace table')
+- self.run_grace_tool(cast(NFSServiceSpec, spec), 'remove', nodeid)
+- self.mgr.spec_store.save_rank_map(spec.service_name(), rank_map)
+ nodeid = self.get_daemon_nodeid(spec.service_name(), rank)
- self.mgr.log.info(
- "Removing %s from the ganesha grace table for service %s", nodeid, service_name
- )
++ self.mgr.log.info(
++ "Removing %s from the ganesha grace table for service %s", nodeid, spec.service_name()
++ )
++ try:
++ self.run_grace_tool(cast(NFSServiceSpec, spec), 'remove', nodeid)
++ # Only delete from rank_map if grace tool succeeds
++ del rank_map[rank]
++ self.mgr.spec_store.save_rank_map(spec.service_name(), rank_map)
++ except RuntimeError:
++ self.mgr.log.exception('Got exception while removing node id from grace table')
+ else:
+ max_gen = max(m.keys())
+ for gen, daemon_id in list(m.items()):
@@ src/pybind/mgr/cephadm/services/nfs.py: class NFSService(CephService):
daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
return daemon_spec
@@ src/pybind/mgr/cephadm/services/nfs.py: class NFSService(CephService):
+
def generate_config(self, daemon_spec: CephadmDaemonDeploySpec) -> Tuple[Dict[str, Any], List[str]]:
assert self.TYPE == daemon_spec.daemon_type
- super().prepare_certificates(daemon_spec)
+
@@ src/pybind/mgr/cephadm/services/nfs.py: class NFSService(CephService):
- host = daemon_spec.host
- spec = cast(NFSServiceSpec, self.mgr.spec_store[daemon_spec.service_name].spec)
+
+ deps: List[str] = []
- nodeid = f'{daemon_spec.rank}'
+ nodeid = self.get_daemon_nodeid(spec.service_name(), daemon_spec.rank)
@@ src/pybind/mgr/cephadm/services/nfs.py: class NFSService(CephService):
nfs_idmap_conf = '/etc/ganesha/idmap.conf'
@@ src/pybind/mgr/cephadm/services/nfs.py: class NFSService(CephService):
- "tls_ktls": spec.tls_ktls,
- "tls_debug": spec.tls_debug,
- "ceph_nodes": ceph_nodes,
+ "nfs_idmap_conf": nfs_idmap_conf,
+ "enable_nlm": str(spec.enable_nlm).lower(),
+ "cluster_id": self.mgr._cluster_fsid,
- "protocols": "3, 4" if spec.enable_nfsv3 else "4"
+ "protocols": "3, 4" if spec.enable_nfsv3 else "4",
+ "use_old_nodeid": False if nodeid.isdigit() else True
@@ src/pybind/mgr/cephadm/services/nfs.py: class NFSService(CephService):
# because the ganesha-grace-tool can only authenticate as a client (and
# not a mgr). Also, it doesn't allow you to pass a keyring location via
@@ src/pybind/mgr/cephadm/services/nfs.py: class NFSService(CephService):
- 'Ignore ganesha-rados-grace tool remove failure as %s does not exists for %s service',
- nodeid, spec.service_name()
- )
-- return
-+ return ''
+ )
+ raise RuntimeError(f'grace tool failed: {result.stderr.decode("utf-8")}')
- raise RuntimeError(f'grace tool failed for service {spec.service_name()}: {stderr}')
+ return result.stdout.decode("utf-8")
-
finally:
self.mgr.check_mon_command({
+ 'prefix': 'auth rm',
## src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 ##
@@ src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2: NFSv4 {
@@ src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2: RGW {
+}
+
+{% endif %}
- {% if tls_add %}
- TLS_CONFIG{
- Enable_TLS = {{ tls_add }};
-
- ## src/pybind/mgr/cephadm/tests/services/test_ingress.py ##
-@@ src/pybind/mgr/cephadm/tests/services/test_ingress.py: class TestIngressService:
- '\n'
- 'RADOS_KV {\n'
- ' UserId = "nfs.foo.test.0.0";\n'
-- ' nodeid = 0;\n'
-+ ' nodeid = "0";\n'
- ' pool = ".nfs";\n'
- ' namespace = "foo";\n'
- '}\n'
+ %url {{ url }}
## src/pybind/mgr/cephadm/tests/test_migration.py ##
@@ src/pybind/mgr/cephadm/tests/test_migration.py: def test_migrate_service_id_mds_one(cephadm_module: CephadmOrchestrator):
@@ src/pybind/mgr/cephadm/tests/test_migration.py: def test_migrate_nfs_initial(cep
@mock.patch("cephadm.serve.CephadmServe._run_cephadm", _run_cephadm('[]'))
def test_migrate_nfs_initial_octopus(cephadm_module: CephadmOrchestrator):
with with_host(cephadm_module, 'host1'):
+
+ ## src/pybind/mgr/cephadm/tests/test_services.py ##
+@@ src/pybind/mgr/cephadm/tests/test_services.py: class TestIngressService:
+ '\n'
+ 'RADOS_KV {\n'
+ ' UserId = "nfs.foo.test.0.0";\n'
+- ' nodeid = 0;\n'
++ ' nodeid = "0";\n'
+ ' pool = ".nfs";\n'
+ ' namespace = "foo";\n'
+ '}\n'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.
When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.
… using it Fixes: https://tracker.ceph.com/issues/71509 Signed-off-by: Shweta Bhosale <[email protected]> (cherry picked from commit 12e2928) Conflicts: src/pybind/mgr/cephadm/migrations.py - due to LAST_MIGRATION change src/pybind/mgr/cephadm/module.py - due to node id changes during nfs service removal src/pybind/mgr/cephadm/services/nfs.py - due to nodeid logic, and nfs protocol field src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2 - removed TLS config src/pybind/mgr/cephadm/tests/services/test_ingress.py - removed TLS related test cases
f51b06c to
0f2548e
Compare
backport tracker: https://tracker.ceph.com/issues/78186
backport of #63617
parent tracker: https://tracker.ceph.com/issues/71509
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh