From f48b9b1e2f61f6d69ce9d2e06eed984e571dbdb7 Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Tue, 22 Oct 2024 19:44:52 +0300 Subject: [PATCH] fix(kms): set proper node regions in multi-dc setups The AWS-KMS code in DB node python class uses shared dictionary from the DB cluster class for updating the KMS endpoint region. It was not a problem when DB nodes setup was serial. In this case shared object was changed by each node but had proper value in needed time frame. After implementation of the parallel DB nodes setup [1] we started getting problems that only one state of that shared object was being applied for all nodes. In single-dc setups everything was correct just because there was no diff among DB node's region names. But in multi-dc setups values from DB nodes started being applied to each other. So, fix it by just deep-copying that shared dictionary to avoid updates of a shared object. [1] https://github.com/scylladb/scylla-cluster-tests/pull/7383 Closes: https://github.com/scylladb/scylla-cluster-tests/issues/9025 (cherry picked from commit ce56367bd50ff0bbfbd4e50e81ee517911df8549) --- sdcm/cluster.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdcm/cluster.py b/sdcm/cluster.py index e7ece636cc..d0e874a267 100644 --- a/sdcm/cluster.py +++ b/sdcm/cluster.py @@ -15,6 +15,7 @@ from __future__ import annotations import contextlib +import copy import queue import logging import os @@ -514,7 +515,7 @@ def proposed_scylla_yaml(self) -> ScyllaYaml: scylla_yml.replace_address_first_boot = self.replacement_node_ip if self.replacement_host_id: scylla_yml.replace_node_first_boot = self.replacement_host_id - if append_scylla_yaml := self.parent_cluster.params.get('append_scylla_yaml') or {}: + if append_scylla_yaml := copy.deepcopy(self.parent_cluster.params.get('append_scylla_yaml')) or {}: if any(key in append_scylla_yaml for key in ( "system_key_directory", "system_info_encryption", "kmip_hosts")): install_encryption_at_rest_files(self.remoter)