Skip to content

Commit 2d8be01

Browse files
committed
Disable 2PC recovery while executing ALTER EXTENSION cmd during Citus upgrade tests
(cherry picked from commit b6b73e2)
1 parent 9a0cc28 commit 2d8be01

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/regress/citus_tests/upgrade/citus_upgrade_test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,16 @@ def run_citus_upgrade_tests(config, before_upgrade_schedule, after_upgrade_sched
6262

6363
install_citus(config.post_tar_path)
6464

65+
# disable 2pc recovery for all nodes to work around https://github.com/citusdata/citus/issues/7875
66+
disable_2pc_recovery_for_all_nodes(config.bindir, config)
67+
6568
restart_databases(config.bindir, config.datadir, config.mixed_mode, config)
6669
run_alter_citus(config.bindir, config.mixed_mode, config)
6770
verify_upgrade(config, config.mixed_mode, config.node_name_to_ports.values())
6871

72+
# re-enable 2pc recovery for all nodes
73+
enable_2pc_recovery_for_all_nodes(config.bindir, config)
74+
6975
run_test_on_coordinator(config, after_upgrade_schedule)
7076
remove_citus(config.post_tar_path)
7177

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

148154

155+
def disable_2pc_recovery_for_all_nodes(pg_path, config):
156+
for port in config.node_name_to_ports.values():
157+
utils.psql(pg_path, port, "ALTER SYSTEM SET citus.recover_2pc_interval TO -1;")
158+
utils.psql(pg_path, port, "SELECT pg_reload_conf();")
159+
160+
161+
def enable_2pc_recovery_for_all_nodes(pg_path, config):
162+
for port in config.node_name_to_ports.values():
163+
utils.psql(pg_path, port, "ALTER SYSTEM RESET citus.recover_2pc_interval;")
164+
utils.psql(pg_path, port, "SELECT pg_reload_conf();")
165+
166+
149167
def run_alter_citus(pg_path, mixed_mode, config):
150168
for port in config.node_name_to_ports.values():
151169
if mixed_mode and port in (

0 commit comments

Comments
 (0)