Skip to content

Commit a9a7642

Browse files
committed
mgr/cephadm: add ordering function for SMB
SMB with CTDB (needed for HA) assumes the SMB daemons of a lower rank will be starting before the daemons of a higher rank. The new function in this commit tells cephadm it must deploy them sequentially in that order. Signed-off-by: Adam King <[email protected]> (cherry picked from commit 833f74d) Resolves: rhbz#2372821
1 parent e22b106 commit a9a7642

File tree

1 file changed

+8
-0
lines changed
  • src/pybind/mgr/cephadm/services

1 file changed

+8
-0
lines changed

src/pybind/mgr/cephadm/services/smb.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ def generate_config(
114114
self._configure_cluster_meta(smb_spec, daemon_spec)
115115
return config_blobs, []
116116

117+
def get_daemon_deployment_ordering(self, daemons: List[CephadmDaemonDeploySpec]) -> Dict[int, List[CephadmDaemonDeploySpec]]:
118+
if not daemons:
119+
return {}
120+
# order SMB deployment by the rank of the daemon
121+
# This is necessary in order for CTDB to work
122+
sorted_by_rank = sorted(daemons, key=lambda dd: dd.rank or -1)
123+
return {i: [sorted_by_rank[i]] for i in range(len(sorted_by_rank))}
124+
117125
def config_dashboard(
118126
self, daemon_descrs: List[DaemonDescription]
119127
) -> None:

0 commit comments

Comments
 (0)