From 9a1d01defb6c6d8bb969a4d95d2d4349cab4ef96 Mon Sep 17 00:00:00 2001 From: Gil Bregman Date: Tue, 8 Jul 2025 15:35:12 +0300 Subject: [PATCH] mgr/cephadm/nvmeof: Add susbsystem cache expiration field to NVMeOF spec file Fixes https://tracker.ceph.com/issues/72019 Signed-off-by: Gil Bregman --- .../cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 | 1 + src/pybind/mgr/cephadm/tests/test_services.py | 1 + src/python-common/ceph/deployment/service_spec.py | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 b/src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 index 735979a548f..bdedb768d50 100644 --- a/src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 +++ b/src/pybind/mgr/cephadm/templates/services/nvmeof/ceph-nvmeof.conf.j2 @@ -41,6 +41,7 @@ max_hosts = {{ spec.max_hosts }} max_namespaces = {{ spec.max_namespaces }} max_namespaces_per_subsystem = {{ spec.max_namespaces_per_subsystem }} max_hosts_per_subsystem = {{ spec.max_hosts_per_subsystem }} +subsystem_cache_expiration = {{ spec.subsystem_cache_expiration }} [gateway-logs] log_level = {{ spec.log_level }} diff --git a/src/pybind/mgr/cephadm/tests/test_services.py b/src/pybind/mgr/cephadm/tests/test_services.py index 1792aee31e6..e0f141dc662 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -390,6 +390,7 @@ max_hosts = 2048 max_namespaces = 2048 max_namespaces_per_subsystem = 256 max_hosts_per_subsystem = 128 +subsystem_cache_expiration = 5 [gateway-logs] log_level = INFO diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 381f12bfb6a..057da09eea9 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -1410,6 +1410,7 @@ class NvmeofServiceSpec(ServiceSpec): max_namespaces: Optional[int] = 2048, max_namespaces_per_subsystem: Optional[int] = 256, max_hosts_per_subsystem: Optional[int] = 128, + subsystem_cache_expiration: Optional[int] = 5, server_key: Optional[str] = None, server_cert: Optional[str] = None, client_key: Optional[str] = None, @@ -1537,6 +1538,8 @@ class NvmeofServiceSpec(ServiceSpec): self.max_namespaces_per_subsystem = max_namespaces_per_subsystem #: ``max_hosts_per_subsystem`` max number of hosts per subsystems self.max_hosts_per_subsystem = max_hosts_per_subsystem + #: ``subsystem_cache_expiration`` number of seconds before subsystems cache expires + self.subsystem_cache_expiration = subsystem_cache_expiration #: ``allowed_consecutive_spdk_ping_failures`` # of ping failures before aborting gateway self.allowed_consecutive_spdk_ping_failures = allowed_consecutive_spdk_ping_failures #: ``spdk_ping_interval_in_seconds`` sleep interval in seconds between SPDK pings @@ -1739,6 +1742,8 @@ class NvmeofServiceSpec(ServiceSpec): verify_positive_int(self.max_namespaces, "Max namespaces") verify_positive_int(self.max_namespaces_per_subsystem, "Max namespaces per subsystem") verify_positive_int(self.max_hosts_per_subsystem, "Max hosts per subsystem") + verify_non_negative_number(self.subsystem_cache_expiration, + "Subsystem cache expiration period") verify_non_negative_number(self.monitor_timeout, "Monitor timeout") verify_non_negative_int(self.port, "Port") verify_non_negative_int(self.discovery_port, "Discovery port") -- 2.39.5