diff options
author | Bruce Momjian <bruce@momjian.us> | 2015-05-16 00:40:18 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2015-05-16 00:40:18 -0400 |
commit | 387a3e46cfdddad2e07f0d1a47d8fcdba89351cd (patch) | |
tree | 34f506d4d3d9b3276fda961c093e1b7f9bb2b548 | |
parent | 31f5d3f3544f76892febccb4c2840ada9e765597 (diff) | |
download | postgresql-387a3e46cfdddad2e07f0d1a47d8fcdba89351cd.tar.gz postgresql-387a3e46cfdddad2e07f0d1a47d8fcdba89351cd.zip |
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
-rw-r--r-- | contrib/pg_upgrade/pg_upgrade.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c index 0dd7de6337d..33035b5835f 100644 --- a/contrib/pg_upgrade/pg_upgrade.c +++ b/contrib/pg_upgrade/pg_upgrade.c @@ -658,8 +658,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(); } |