From f6c6813593b8c45b7f60fe2a13f2e73324c1f056 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Wed, 2 Apr 2025 15:57:48 +0100 Subject: [PATCH 1/3] MAINT try alternate migration approach --- plans/migrate.pp | 22 ++++++++++++------- .../peadm_spec/plans/test_migration.pp | 2 ++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/plans/migrate.pp b/plans/migrate.pp index 99796fd4..f1b12017 100644 --- a/plans/migrate.pp +++ b/plans/migrate.pp @@ -14,7 +14,15 @@ Peadm::SingleTargetSpec $new_primary_host, Optional[String] $upgrade_version = undef, Optional[Peadm::SingleTargetSpec] $replica_host = undef, + Optional[Peadm::SingleTargetSpec] $primary_postgresql_host = undef, + Optional[Peadm::SingleTargetSpec] $replica_postgresql_host = undef, ) { + out::message("old_primary_host: ${old_primary_host}") + out::message("new_primary_host: ${new_primary_host}") + out::message("upgrade_version: ${upgrade_version}") + out::message("replica_host: ${replica_host}") + out::message("primary_postgresql_host: ${primary_postgresql_host}") + out::message("replica_postgresql_host: ${replica_postgresql_host}") # pre-migration checks out::message('This plan is a work in progress and it is not recommended to be used until it is fully implemented and supported') peadm::assert_supported_bolt_version() @@ -26,7 +34,9 @@ $all_hosts = peadm::flatten_compact([ $old_primary_host, $new_primary_host, - $replica_host ? { undef => [], default => [$replica_host] } + $replica_host ? { undef => [], default => [$replica_host] }, + $primary_postgresql_host ? { undef => [], default => [$primary_postgresql_host] }, + $replica_postgresql_host ? { undef => [], default => [$replica_postgresql_host] } ].flatten) run_command('hostname', $all_hosts) # verify can connect to targets @@ -67,6 +77,9 @@ run_plan('peadm::install', { primary_host => $new_primary_host, + replica_host => $replica_host, + primary_postgresql_host => $primary_postgresql_host, + replica_postgresql_host => $replica_postgresql_host, console_password => $old_primary_password, code_manager_auto_configure => true, download_mode => 'direct', @@ -114,13 +127,6 @@ out::message('No nodes to purge from old configuration') } - if $replica_host { - run_plan('peadm::add_replica', { - primary_host => $new_primary_host, - replica_host => $replica_host, - }) - } - if $upgrade_version and $upgrade_version != '' and !empty($upgrade_version) { run_plan('peadm::upgrade', { primary_host => $new_primary_host, diff --git a/spec/acceptance/peadm_spec/plans/test_migration.pp b/spec/acceptance/peadm_spec/plans/test_migration.pp index 7f17e636..d323a74a 100644 --- a/spec/acceptance/peadm_spec/plans/test_migration.pp +++ b/spec/acceptance/peadm_spec/plans/test_migration.pp @@ -30,6 +30,8 @@ new_primary_host => $new_primary_target, upgrade_version => $upgrade_version, replica_host => $new_replica_target, + primary_postgresql_host => $new_primary_postgresql_target, + replica_postgresql_host => $new_replica_postgresql_target, ) # run infra status on the new primary From 75ae177ec2edcab2dc5c418276a4bca79f0e1d5e Mon Sep 17 00:00:00 2001 From: David Mallon Date: Wed, 2 Apr 2025 21:47:07 +0100 Subject: [PATCH 2/3] MAINT see if excluding the restore on a replica helps --- plans/restore.pp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plans/restore.pp b/plans/restore.pp index bbb8bd95..34037f87 100644 --- a/plans/restore.pp +++ b/plans/restore.pp @@ -78,9 +78,12 @@ undef => $primary_target, default => peadm::get_targets(getvar('cluster.params.primary_postgresql_host'), 1), }, - getvar('cluster.params.replica_postgresql_host') ? { - undef => $replica_target, - default => peadm::get_targets(getvar('cluster.params.replica_postgresql_host'), 1), + ($restore_type != 'migration') ? { + true => getvar('cluster.params.replica_postgresql_host') ? { + undef => $replica_target, + default => peadm::get_targets(getvar('cluster.params.replica_postgresql_host'), 1), + }, + default => [], }, ]) From 5b0062effddb6c1de56553b947d3ce1235669231 Mon Sep 17 00:00:00 2001 From: David Mallon Date: Wed, 2 Apr 2025 22:36:01 +0100 Subject: [PATCH 3/3] MAINT add XL in --- .github/workflows/test-migration.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-migration.yaml b/.github/workflows/test-migration.yaml index 59633b11..ca5d527f 100644 --- a/.github/workflows/test-migration.yaml +++ b/.github/workflows/test-migration.yaml @@ -40,9 +40,9 @@ jobs: - standard - standard-with-dr - large - # - extra-large + - extra-large - large-with-dr - # - extra-large-with-dr + - extra-large-with-dr version: [2021.7.9, 2023.8.2, 2025.2.0] image: [almalinux-cloud/almalinux-8] include: