From: Bruce Momjian Date: Sat, 16 May 2015 04:40:18 +0000 (-0400) Subject: pg_upgrade: force timeline 1 in the new cluster X-Git-Tag: REL9_3_7~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bffbeec0cb387e0453484d26444ad6fb281c9331;p=thirdparty%2Fpostgresql.git 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 --- diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c index c67ca19cb51..72f8fac9b8b 100644 --- a/contrib/pg_upgrade/pg_upgrade.c +++ b/contrib/pg_upgrade/pg_upgrade.c @@ -659,8 +659,9 @@ copy_clog_xlog_xid(void) /* now reset the wal archives in the new cluster */ prep_status("Resetting WAL archives"); exec_prog(UTILITY_LOG_FILE, NULL, true, - "\"%s/pg_resetxlog\" -l %s \"%s\"", new_cluster.bindir, - old_cluster.controldata.nextxlogfile, + /* use timeline 1 to match controldata and no WAL history file */ + "\"%s/pg_resetxlog\" -l 00000001%s \"%s\"", new_cluster.bindir, + old_cluster.controldata.nextxlogfile + 8, new_cluster.pgdata); check_ok(); }