Change delimiter used for display of NextXID
authorJoe Conway <[email protected]>
Fri, 12 Feb 2016 22:23:59 +0000 (14:23 -0800)
committerJoe Conway <[email protected]>
Fri, 12 Feb 2016 22:23:59 +0000 (14:23 -0800)
NextXID has been rendered in the form of a pg_lsn even though it
really is not. This can cause confusion, so change the format from
%u/%u to %u:%u, per discussion on hackers.

Complaint by me, patch by me and Bruce, reviewed by Michael Paquier
and Alvaro. Applied to HEAD only.

Author: Joe Conway, Bruce Momjian
Reviewed-by: Michael Paquier, Alvaro Herrera
Backpatch-through: master

src/backend/access/rmgrdesc/xlogdesc.c
src/backend/access/transam/xlog.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_resetxlog/pg_resetxlog.c
src/bin/pg_upgrade/controldata.c

index b694dea53cd86f53e9c2e0d81dae5b3e4edcd031..2dcbfbda3727236ebd7de34910518e899218ea1e 100644 (file)
@@ -43,7 +43,7 @@ xlog_desc(StringInfo buf, XLogReaderState *record)
        CheckPoint *checkpoint = (CheckPoint *) rec;
 
        appendStringInfo(buf, "redo %X/%X; "
-                        "tli %u; prev tli %u; fpw %s; xid %u/%u; oid %u; multi %u; offset %u; "
+                        "tli %u; prev tli %u; fpw %s; xid %u:%u; oid %u; multi %u; offset %u; "
                         "oldest xid %u in DB %u; oldest multi %u in DB %u; "
                         "oldest/newest commit timestamp xid: %u/%u; "
                         "oldest running xid %u; %s",
index e98c89f7aa5d5b341cbe116df46bf37d2f01cf33..8d480f7ce24f31e39a916588c5f829b69eeed520 100644 (file)
@@ -6283,7 +6283,7 @@ StartupXLOG(void)
                  (uint32) (checkPoint.redo >> 32), (uint32) checkPoint.redo,
                    wasShutdown ? "TRUE" : "FALSE")));
    ereport(DEBUG1,
-           (errmsg_internal("next transaction ID: %u/%u; next OID: %u",
+           (errmsg_internal("next transaction ID: %u:%u; next OID: %u",
                    checkPoint.nextXidEpoch, checkPoint.nextXid,
                    checkPoint.nextOid)));
    ereport(DEBUG1,
index e7e072f7f38dcde54b6dcfa357c6c22c8679c4a5..5dd2dbc5da5fe46b53dfd1269789d8338b0baae3 100644 (file)
@@ -252,7 +252,7 @@ main(int argc, char *argv[])
           ControlFile.checkPointCopy.PrevTimeLineID);
    printf(_("Latest checkpoint's full_page_writes: %s\n"),
           ControlFile.checkPointCopy.fullPageWrites ? _("on") : _("off"));
-   printf(_("Latest checkpoint's NextXID:          %u/%u\n"),
+   printf(_("Latest checkpoint's NextXID:          %u:%u\n"),
           ControlFile.checkPointCopy.nextXidEpoch,
           ControlFile.checkPointCopy.nextXid);
    printf(_("Latest checkpoint's NextOID:          %u\n"),
index ca706a5420fe04b90d1f0989cf67f3c85a9e7c27..525b82ba7a77be18a19e1076f88a7dc72af516ce 100644 (file)
@@ -646,7 +646,7 @@ PrintControlValues(bool guessed)
           ControlFile.checkPointCopy.ThisTimeLineID);
    printf(_("Latest checkpoint's full_page_writes: %s\n"),
           ControlFile.checkPointCopy.fullPageWrites ? _("on") : _("off"));
-   printf(_("Latest checkpoint's NextXID:          %u/%u\n"),
+   printf(_("Latest checkpoint's NextXID:          %u:%u\n"),
           ControlFile.checkPointCopy.nextXidEpoch,
           ControlFile.checkPointCopy.nextXid);
    printf(_("Latest checkpoint's NextOID:          %u\n"),
index 2def7290a24670d9e7a8147e0706e6820d425193..34e194cb8bbf090a349f2f198f5d70255f920527 100644 (file)
@@ -197,11 +197,18 @@ get_control_data(ClusterInfo *cluster, bool live_check)
            p++;                /* remove ':' char */
            cluster->controldata.chkpnt_nxtepoch = str2uint(p);
 
-           p = strchr(p, '/');
+           if (strchr(p, '/') != NULL)
+               p = strchr(p, '/');
+           /* delimiter changed from '/' to ':' in 9.6 */
+           else if (GET_MAJOR_VERSION(cluster->major_version) >= 906)
+               p = strchr(p, ':');
+           else
+               p = NULL;
+
            if (p == NULL || strlen(p) <= 1)
                pg_fatal("%d: controldata retrieval problem\n", __LINE__);
 
-           p++;                /* remove '/' char */
+           p++;                /* remove '/' or ':' char */
            cluster->controldata.chkpnt_nxtxid = str2uint(p);
            got_xid = true;
        }