Skip to content

Commit f6c6813

Browse files
MAINT try alternate migration approach
1 parent 59e616d commit f6c6813

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

plans/migrate.pp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@
1414
Peadm::SingleTargetSpec $new_primary_host,
1515
Optional[String] $upgrade_version = undef,
1616
Optional[Peadm::SingleTargetSpec] $replica_host = undef,
17+
Optional[Peadm::SingleTargetSpec] $primary_postgresql_host = undef,
18+
Optional[Peadm::SingleTargetSpec] $replica_postgresql_host = undef,
1719
) {
20+
out::message("old_primary_host: ${old_primary_host}")
21+
out::message("new_primary_host: ${new_primary_host}")
22+
out::message("upgrade_version: ${upgrade_version}")
23+
out::message("replica_host: ${replica_host}")
24+
out::message("primary_postgresql_host: ${primary_postgresql_host}")
25+
out::message("replica_postgresql_host: ${replica_postgresql_host}")
1826
# pre-migration checks
1927
out::message('This plan is a work in progress and it is not recommended to be used until it is fully implemented and supported')
2028
peadm::assert_supported_bolt_version()
@@ -26,7 +34,9 @@
2634
$all_hosts = peadm::flatten_compact([
2735
$old_primary_host,
2836
$new_primary_host,
29-
$replica_host ? { undef => [], default => [$replica_host] }
37+
$replica_host ? { undef => [], default => [$replica_host] },
38+
$primary_postgresql_host ? { undef => [], default => [$primary_postgresql_host] },
39+
$replica_postgresql_host ? { undef => [], default => [$replica_postgresql_host] }
3040
].flatten)
3141
run_command('hostname', $all_hosts) # verify can connect to targets
3242
@@ -67,6 +77,9 @@
6777
6878
run_plan('peadm::install', {
6979
primary_host => $new_primary_host,
80+
replica_host => $replica_host,
81+
primary_postgresql_host => $primary_postgresql_host,
82+
replica_postgresql_host => $replica_postgresql_host,
7083
console_password => $old_primary_password,
7184
code_manager_auto_configure => true,
7285
download_mode => 'direct',
@@ -114,13 +127,6 @@
114127
out::message('No nodes to purge from old configuration')
115128
}
116129
117-
if $replica_host {
118-
run_plan('peadm::add_replica', {
119-
primary_host => $new_primary_host,
120-
replica_host => $replica_host,
121-
})
122-
}
123-
124130
if $upgrade_version and $upgrade_version != '' and !empty($upgrade_version) {
125131
run_plan('peadm::upgrade', {
126132
primary_host => $new_primary_host,

spec/acceptance/peadm_spec/plans/test_migration.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
new_primary_host => $new_primary_target,
3131
upgrade_version => $upgrade_version,
3232
replica_host => $new_replica_target,
33+
primary_postgresql_host => $new_primary_postgresql_target,
34+
replica_postgresql_host => $new_replica_postgresql_target,
3335
)
3436

3537
# run infra status on the new primary

0 commit comments

Comments
 (0)