Skip to content

Commit

Permalink
Disable 2PC recovery while executing ALTER EXTENSION cmd during Citus…
Browse files Browse the repository at this point in the history
… upgrade tests

(cherry picked from commit b6b73e2)
  • Loading branch information
onurctirtir committed Feb 4, 2025
1 parent 9a0cc28 commit 2d8be01
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/regress/citus_tests/upgrade/citus_upgrade_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ def run_citus_upgrade_tests(config, before_upgrade_schedule, after_upgrade_sched

install_citus(config.post_tar_path)

# disable 2pc recovery for all nodes to work around https://github.com/citusdata/citus/issues/7875
disable_2pc_recovery_for_all_nodes(config.bindir, config)

restart_databases(config.bindir, config.datadir, config.mixed_mode, config)
run_alter_citus(config.bindir, config.mixed_mode, config)
verify_upgrade(config, config.mixed_mode, config.node_name_to_ports.values())

# re-enable 2pc recovery for all nodes
enable_2pc_recovery_for_all_nodes(config.bindir, config)

run_test_on_coordinator(config, after_upgrade_schedule)
remove_citus(config.post_tar_path)

Expand Down Expand Up @@ -146,6 +152,18 @@ def restart_database(pg_path, abs_data_path, node_name, node_ports, logfile_pref
subprocess.run(command, check=True)


def disable_2pc_recovery_for_all_nodes(pg_path, config):
for port in config.node_name_to_ports.values():
utils.psql(pg_path, port, "ALTER SYSTEM SET citus.recover_2pc_interval TO -1;")
utils.psql(pg_path, port, "SELECT pg_reload_conf();")


def enable_2pc_recovery_for_all_nodes(pg_path, config):
for port in config.node_name_to_ports.values():
utils.psql(pg_path, port, "ALTER SYSTEM RESET citus.recover_2pc_interval;")
utils.psql(pg_path, port, "SELECT pg_reload_conf();")


def run_alter_citus(pg_path, mixed_mode, config):
for port in config.node_name_to_ports.values():
if mixed_mode and port in (
Expand Down

0 comments on commit 2d8be01

Please sign in to comment.