summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2015-05-16 15:16:28 -0400
committerBruce Momjian <bruce@momjian.us>2015-05-16 15:16:28 -0400
commit4e9935979aff55b6e6e47ed9649ae6bf01bc228a (patch)
tree35e727f41e38ad1553dc20325ac9d359e3caee9c
parentb054732070a65adb9a6c12bfaed3a0e5b1935135 (diff)
pg_upgrade: properly handle timeline variables
There is no behavior change here as we now always set the timeline to one. Report by Tom Lane Backpatch to 9.3 and 9.4
-rw-r--r--contrib/pg_upgrade/controldata.c10
-rw-r--r--contrib/pg_upgrade/pg_upgrade.h1
2 files changed, 3 insertions, 8 deletions
diff --git a/contrib/pg_upgrade/controldata.c b/contrib/pg_upgrade/controldata.c
index b0da994c141..2a4b636245f 100644
--- a/contrib/pg_upgrade/controldata.c
+++ b/contrib/pg_upgrade/controldata.c
@@ -229,7 +229,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
pg_log(PG_FATAL, "%d: controldata retrieval problem\n", __LINE__);
p++; /* removing ':' char */
- cluster->controldata.chkpnt_tli = str2uint(p);
+ tli = str2uint(p);
got_tli = true;
}
else if ((p = strstr(bufin, "Latest checkpoint's NextXID:")) != NULL)
@@ -479,11 +479,11 @@ get_control_data(ClusterInfo *cluster, bool live_check)
* Before 9.3, pg_resetxlog reported the xlogid and segno of the first log
* file after reset as separate lines. Starting with 9.3, it reports the
* WAL file name. If the old cluster is older than 9.3, we construct the
- * WAL file name from the xlogid and segno.
+ * WAL file name from the tli, xlogid, and segno.
*/
if (GET_MAJOR_VERSION(cluster->major_version) <= 902)
{
- if (got_log_id && got_log_seg)
+ if (got_tli && got_log_id && got_log_seg)
{
snprintf(cluster->controldata.nextxlogfile, 25, "%08X%08X%08X",
tli, logid, segno);
@@ -497,7 +497,6 @@ get_control_data(ClusterInfo *cluster, bool live_check)
(!got_oldestmulti &&
cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER) ||
(!live_check && !got_nextxlogfile) ||
- !got_tli ||
!got_align || !got_blocksz || !got_largesz || !got_walsz ||
!got_walseg || !got_ident || !got_index || !got_toast ||
!got_date_is_int || !got_float8_pass_by_value || !got_data_checksum_version)
@@ -525,9 +524,6 @@ get_control_data(ClusterInfo *cluster, bool live_check)
if (!live_check && !got_nextxlogfile)
pg_log(PG_REPORT, " first WAL segment after reset\n");
- if (!got_tli)
- pg_log(PG_REPORT, " latest checkpoint timeline ID\n");
-
if (!got_align)
pg_log(PG_REPORT, " maximum alignment\n");
diff --git a/contrib/pg_upgrade/pg_upgrade.h b/contrib/pg_upgrade/pg_upgrade.h
index f50388fedbd..85c737932df 100644
--- a/contrib/pg_upgrade/pg_upgrade.h
+++ b/contrib/pg_upgrade/pg_upgrade.h
@@ -186,7 +186,6 @@ typedef struct
uint32 ctrl_ver;
uint32 cat_ver;
char nextxlogfile[25];
- uint32 chkpnt_tli;
uint32 chkpnt_nxtxid;
uint32 chkpnt_nxtepoch;
uint32 chkpnt_nxtoid;