pg_upgrade: force timeline 1 in the new cluster
authorBruce Momjian <[email protected]>
Sat, 16 May 2015 04:40:18 +0000 (00:40 -0400)
committerBruce Momjian <[email protected]>
Sat, 16 May 2015 04:40:18 +0000 (00:40 -0400)
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

contrib/pg_upgrade/pg_upgrade.c

index c4f71ba5c195dd03c2f2a1c2c1e129b5faa4be89..452cde45c2ee2c1a6a944cb7e890bc071a5d1f5f 100644 (file)
@@ -470,8 +470,8 @@ copy_clog_xlog_xid(migratorContext *ctx)
 
    /* now reset the wal archives in the new cluster */
    prep_status(ctx, "Resetting WAL archives");
-   exec_prog(ctx, true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -l %u,%u,%u \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
-             ctx->new.bindir, ctx->old.controldata.chkpnt_tli,
+   exec_prog(ctx, true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -l 1,%u,%u \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
+             ctx->new.bindir,
              ctx->old.controldata.logid, ctx->old.controldata.nxtlogseg,
              ctx->new.pgdata,
 #ifndef WIN32