Skip to content

Commit df161c9

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 2194aa9 commit df161c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/pg_upgrade/pg_upgrade.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ copy_clog_xlog_xid(migratorContext *ctx)
470470

471471
/* now reset the wal archives in the new cluster */
472472
prep_status(ctx, "Resetting WAL archives");
473-
exec_prog(ctx, true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -l %u,%u,%u \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
474-
ctx->new.bindir, ctx->old.controldata.chkpnt_tli,
473+
exec_prog(ctx, true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -l 1,%u,%u \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
474+
ctx->new.bindir,
475475
ctx->old.controldata.logid, ctx->old.controldata.nxtlogseg,
476476
ctx->new.pgdata,
477477
#ifndef WIN32

0 commit comments

Comments
 (0)