Skip to content

Commit

Permalink
fix(kms): set proper node regions in multi-dc setups
Browse files Browse the repository at this point in the history
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] #7383

Closes: #9025
(cherry picked from commit ce56367)
  • Loading branch information
vponomaryov authored and mergify[bot] committed Oct 23, 2024
1 parent 1a1717d commit 522fbfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdcm/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from __future__ import annotations

import contextlib
import copy
import queue
import logging
import os
Expand Down Expand Up @@ -508,7 +509,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)
Expand Down

0 comments on commit 522fbfc

Please sign in to comment.