From a3cb7a879c24019c922e4d710f2eaf2597ef48f3 Mon Sep 17 00:00:00 2001 From: Polina Bungina Date: Wed, 26 Jun 2024 16:47:15 +0200 Subject: [PATCH] test --- postgres-appliance/bootstrap/clone_with_wale.py | 4 ++-- postgres-appliance/scripts/wale_restore.sh | 2 +- postgres-appliance/tests/test_spilo.sh | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/postgres-appliance/bootstrap/clone_with_wale.py b/postgres-appliance/bootstrap/clone_with_wale.py index c575daccc..9e0adc1c5 100755 --- a/postgres-appliance/bootstrap/clone_with_wale.py +++ b/postgres-appliance/bootstrap/clone_with_wale.py @@ -57,7 +57,7 @@ def fix_output(output): started = None for line in output.decode('utf-8').splitlines(): if not started: - started = re.match(r'^name\s+last_modified\s+', line) or re.match(r'^name\s+modified\s+', line) + started = re.match(r'^(backup_)?name\s+(last_)?modified\s+', line) if started: line = line.replace(' modified ', ' last_modified ') if started: @@ -75,7 +75,7 @@ def choose_backup(backup_list, recovery_target_time): match = backup match_timestamp = last_modified if match is not None: - return match['name'] + return match.get('name', match['backup_name']) def list_backups(env): diff --git a/postgres-appliance/scripts/wale_restore.sh b/postgres-appliance/scripts/wale_restore.sh index 138dfecae..d641efb91 100755 --- a/postgres-appliance/scripts/wale_restore.sh +++ b/postgres-appliance/scripts/wale_restore.sh @@ -43,7 +43,7 @@ ATTEMPT=0 server_version="-1" while true; do [[ -z $wal_segment_backup_start ]] && wal_segment_backup_start=$($WAL_E backup-list 2> /dev/null \ - | sed '0,/^name\s*\(last_\)\?modified\s*/d' | sort -bk2 | tail -n1 | awk '{print $3;}' | sed 's/_.*$//') + | sed '0,/^(backup_\)?name\s*\(last_\)\?modified\s*/d' | sort -bk2 | tail -n1 | awk '{print $3;}' | sed 's/_.*$//') [[ -n "$CONNSTR" && $server_version == "-1" ]] && server_version=$(psql -d "$CONNSTR" -tAc 'show server_version_num' 2> /dev/null || echo "-1") diff --git a/postgres-appliance/tests/test_spilo.sh b/postgres-appliance/tests/test_spilo.sh index 2ac170a25..70dccf711 100755 --- a/postgres-appliance/tests/test_spilo.sh +++ b/postgres-appliance/tests/test_spilo.sh @@ -292,7 +292,9 @@ function test_spilo() { # TEST SUITE 1 - find_leader "$upgrade_container" # wait clone to finish and prevent timescale installation gets cloned + # wait clone to finish and prevent timescale installation gets cloned + find_leader "$upgrade_container" + find_leader "$upgrade3_container" log_info "[TS1] Testing in-place major upgrade 11->13 with failing check" create_timescaledb "$container" # we don't install it at the beginning, as we do 11->16 in a clone