Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4c5e060

Browse files
committed
pg_upgrade: force timeline 1 in the new cluster
Previously, this prevented promoted standby servers from being upgraded because of a missing WAL history file. (Timeline 1 doesn't need a history file, and we don't copy WAL files anyway.) Report by Christian Echerer(?), Alexey Klyukin Backpatch through 9.0
1 parent fb694d9 commit 4c5e060

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/pg_upgrade/pg_upgrade.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,9 @@ copy_clog_xlog_xid(void)
473473
/* now reset the wal archives in the new cluster */
474474
prep_status("Resetting WAL archives");
475475
exec_prog(UTILITY_LOG_FILE, NULL, true,
476-
"\"%s/pg_resetxlog\" -l %s \"%s\"", new_cluster.bindir,
477-
old_cluster.controldata.nextxlogfile,
476+
/* use timeline 1 to match controldata and no WAL history file */
477+
"\"%s/pg_resetxlog\" -l 00000001%s \"%s\"", new_cluster.bindir,
478+
old_cluster.controldata.nextxlogfile + 8,
478479
new_cluster.pgdata);
479480
check_ok();
480481
}

0 commit comments

Comments
 (0)