Skip to content

Commit 4283b38

Browse files
Paul Guolss602726449
authored andcommitted
Add argument --next-gxid in pg_resetwal to support next-gxid reset.
Reviewed-by: Gang Xiong <[email protected]>
1 parent 469b51c commit 4283b38

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/bin/pg_resetwal/pg_resetwal.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,9 @@ main(int argc, char *argv[])
564564
FullTransactionIdFromEpochAndXid(EpochFromFullTransactionId(ControlFile.checkPointCopy.nextXid),
565565
set_xid);
566566

567+
if (set_gxid != 0)
568+
ControlFile.checkPointCopy.nextGxid = set_gxid;
569+
567570
if (set_oldest_commit_ts_xid != 0)
568571
ControlFile.checkPointCopy.oldestCommitTsXid = set_oldest_commit_ts_xid;
569572
if (set_newest_commit_ts_xid != 0)
@@ -1542,12 +1545,10 @@ usage(void)
15421545
printf(_(" -O, --multixact-offset=OFFSET set next multitransaction offset\n"));
15431546
printf(_(" -r RELFILENODE set next RELFILENODE\n"));
15441547
printf(_(" --system-identifier=ID set database system identifier\n"));
1545-
printf(_(" -u, --oldest-transaction-id=XID set oldest transaction ID\n"));
1546-
printf(_(" -V, --version output version information, then exit\n"));
1547-
printf(_(" -x, --next-transaction-id=XID set next transaction ID\n"));
1548+
printf(_(" -V, --version output version information, then exit\n"));
1549+
printf(_(" -x, --next-transaction-id=XID set next transaction ID\n"));
15481550
printf(_(" --next-gxid=GXID set next distributed transaction ID\n"));
1549-
printf(_(" --wal-segsize=SIZE size of WAL segments, in megabytes\n"));
1550-
printf(_(" -?, --help show this help, then exit\n"));
1551-
printf(_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
1552-
printf(_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
1551+
printf(_(" --wal-segsize=SIZE size of WAL segments, in megabytes\n"));
1552+
printf(_(" -?, --help show this help, then exit\n"));
1553+
printf(_("\nReport bugs to <[email protected]>.\n"));
15531554
}

0 commit comments

Comments
 (0)