Skip to content

Commit

Permalink
Fix mixed Citus upgrade tests (#7218)
Browse files Browse the repository at this point in the history
When testing rolling Citus upgrades, coordinator should not be upgraded
until we upgrade all the workers.

---------

Co-authored-by: Jelte Fennema-Nio <[email protected]>
(-partially- cherry picked from commit 27ac44e)
  • Loading branch information
onurctirtir committed Feb 4, 2025
1 parent 3953fe4 commit 86a2833
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/test/regress/citus_tests/upgrade/citus_upgrade_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def remove_tar_files(tar_path):

def restart_databases(pg_path, rel_data_path, mixed_mode, config):
for node_name in config.node_name_to_ports.keys():
if (
mixed_mode
and config.node_name_to_ports[node_name] == config.chosen_random_worker_port
if mixed_mode and config.node_name_to_ports[node_name] in (
config.chosen_random_worker_port,
config.coordinator_port(),
):
continue
abs_data_path = os.path.abspath(os.path.join(rel_data_path, node_name))
Expand Down Expand Up @@ -135,7 +135,10 @@ def restart_database(pg_path, abs_data_path, node_name, node_ports, logfile_pref

def run_alter_citus(pg_path, mixed_mode, config):
for port in config.node_name_to_ports.values():
if mixed_mode and port == config.chosen_random_worker_port:
if mixed_mode and port in (
config.chosen_random_worker_port,
config.coordinator_port(),
):
continue
utils.psql(pg_path, port, "ALTER EXTENSION citus UPDATE;")

Expand All @@ -145,7 +148,8 @@ def verify_upgrade(config, mixed_mode, node_ports):
actual_citus_version = get_actual_citus_version(config.bindir, port)
expected_citus_version = MASTER_VERSION
if expected_citus_version != actual_citus_version and not (
mixed_mode and port == config.chosen_random_worker_port
mixed_mode
and port in (config.chosen_random_worker_port, config.coordinator_port())
):
print(
"port: {} citus version {} expected {}".format(
Expand Down

0 comments on commit 86a2833

Please sign in to comment.