public inbox for [email protected]
help / color / mirror / Atom feed[PATCH v9 5/8] Invalidate parent indexes
3+ messages / 3 participants
[nested] [flat]
* [PATCH v9 5/8] Invalidate parent indexes
@ 2020-11-06 00:58 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: Justin Pryzby @ 2020-11-06 00:58 UTC (permalink / raw)
---
src/backend/commands/cluster.c | 21 +++++++++++++++++++++
src/test/regress/expected/cluster.out | 26 ++++++++++++++++++++++++++
src/test/regress/sql/cluster.sql | 8 ++++++++
3 files changed, 55 insertions(+)
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index dd8014c206..8a2e66bbeb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -598,6 +598,27 @@ mark_index_clustered(Relation rel, Oid indexOid, bool is_internal)
}
list_free(inh);
+ /*
+ * Set parent of all indexes as unclustered when a rel is unclustered; and,
+ * when an index is clustered, set parents of all /other/ indexes as
+ * unclustered.
+ */
+ indexes = RelationGetIndexList(rel);
+ foreach (lc, indexes)
+ {
+ Oid thisIndexOid = lfirst_oid(lc);
+
+ if (thisIndexOid == indexOid)
+ continue;
+
+ while (get_rel_relispartition(thisIndexOid))
+ {
+ thisIndexOid = get_partition_parent(thisIndexOid);
+ set_indisclustered(thisIndexOid, false, pg_index);
+ }
+ }
+ list_free(indexes);
+
table_close(pg_index, RowExclusiveLock);
}
diff --git a/src/test/regress/expected/cluster.out b/src/test/regress/expected/cluster.out
index 1d436dfaae..6cba3cc4f9 100644
--- a/src/test/regress/expected/cluster.out
+++ b/src/test/regress/expected/cluster.out
@@ -541,6 +541,32 @@ Indexes:
"clstrpart1_idx_2" btree (a) CLUSTER
Number of partitions: 2 (Use \d+ to list them.)
+-- Check that the parent index is marked not clustered after clustering a partition on a different index:
+ALTER TABLE clstrpart CLUSTER ON clstrpart_idx;
+CLUSTER clstrpart1 USING clstrpart1_idx_2;
+\d clstrpart
+ Partitioned table "public.clstrpart"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+Partition key: RANGE (a)
+Indexes:
+ "clstrpart_idx" btree (a)
+Number of partitions: 3 (Use \d+ to list them.)
+
+-- Check that the parent index is marked not clustered after setting a partition not clustered:
+ALTER TABLE clstrpart CLUSTER ON clstrpart_idx;
+ALTER TABLE clstrpart1 SET WITHOUT CLUSTER;
+\d clstrpart
+ Partitioned table "public.clstrpart"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ a | integer | | |
+Partition key: RANGE (a)
+Indexes:
+ "clstrpart_idx" btree (a)
+Number of partitions: 3 (Use \d+ to list them.)
+
-- Test CLUSTER with external tuplesorting
create table clstr_4 as select * from tenk1;
create index cluster_sort on clstr_4 (hundred, thousand, tenthous);
diff --git a/src/test/regress/sql/cluster.sql b/src/test/regress/sql/cluster.sql
index 0ded2be1ca..a1d132f288 100644
--- a/src/test/regress/sql/cluster.sql
+++ b/src/test/regress/sql/cluster.sql
@@ -231,6 +231,14 @@ CREATE INDEX clstrpart1_idx_2 ON clstrpart1(a);
ALTER TABLE clstrpart CLUSTER ON clstrpart_idx;
ALTER TABLE clstrpart1 CLUSTER ON clstrpart1_idx_2;
\d clstrpart1
+-- Check that the parent index is marked not clustered after clustering a partition on a different index:
+ALTER TABLE clstrpart CLUSTER ON clstrpart_idx;
+CLUSTER clstrpart1 USING clstrpart1_idx_2;
+\d clstrpart
+-- Check that the parent index is marked not clustered after setting a partition not clustered:
+ALTER TABLE clstrpart CLUSTER ON clstrpart_idx;
+ALTER TABLE clstrpart1 SET WITHOUT CLUSTER;
+\d clstrpart
-- Test CLUSTER with external tuplesorting
--
2.17.0
--fmvA4kSBHQVZhkR6
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v9-0006-Invalidate-parent-index-cluster-on-attach.patch"
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: using an end-of-recovery record in all cases
@ 2022-01-16 04:52 Julien Rouhaud <[email protected]>
2022-04-18 20:44 ` Re: using an end-of-recovery record in all cases Robert Haas <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: Julien Rouhaud @ 2022-01-16 04:52 UTC (permalink / raw)
To: Amul Sul <[email protected]>; +Cc: Robert Haas <[email protected]>; Andres Freund <[email protected]>; Kyotaro Horiguchi <[email protected]>; PostgreSQL Hackers <[email protected]>
Hi,
On Mon, Oct 18, 2021 at 10:56:53AM +0530, Amul Sul wrote:
>
> Attached is the rebased and updated version. The patch removes the
> newly introduced PerformRecoveryXLogAction() function. In addition to
> that, removed the CHECKPOINT_END_OF_RECOVERY flag and its related
> code. Also, dropped changes for bgwriter.c and slot.c in this patch, which
> seem unrelated to this work.
The cfbot reports that this version of the patch doesn't apply anymore:
http://cfbot.cputube.org/patch_36_3365.log
=== Applying patches on top of PostgreSQL commit ID 0c53a6658e47217ad3dd416a5543fc87c3ecfd58 ===
=== applying patch ./v3-0001-Always-use-an-end-of-recovery-record-rather-than-.patch
patching file src/backend/access/transam/xlog.c
[...]
Hunk #14 FAILED at 9061.
Hunk #15 FAILED at 9241.
2 out of 15 hunks FAILED -- saving rejects to file src/backend/access/transam/xlog.c.rej
Can you send a rebased version? In the meantime I will switch the cf entry to
Waiting on Author.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: using an end-of-recovery record in all cases
2022-01-16 04:52 Re: using an end-of-recovery record in all cases Julien Rouhaud <[email protected]>
@ 2022-04-18 20:44 ` Robert Haas <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: Robert Haas @ 2022-04-18 20:44 UTC (permalink / raw)
To: Julien Rouhaud <[email protected]>; +Cc: Amul Sul <[email protected]>; Andres Freund <[email protected]>; Kyotaro Horiguchi <[email protected]>; PostgreSQL Hackers <[email protected]>
On Sat, Jan 15, 2022 at 11:52 PM Julien Rouhaud <[email protected]> wrote:
> The cfbot reports that this version of the patch doesn't apply anymore:
Here is a new version of the patch which, unlike v1, I think is
something we could seriously consider applying (not before v16, of
course). It now removes CHECKPOINT_END_OF_RECOVERY completely, and I
attach a second patch as well which nukes checkPoint.PrevTimeLineID as
well.
I mentioned two problems with $SUBJECT in the first email with this
subject line. One was a bug, which Noah has since fixed (thanks,
Noah). The other problem is that LogStandbySnapshot() and a bunch of
its friends expect latestCompletedXid to always be a normal XID, which
is a problem because (1) we currently set nextXid to 3 and (2) at
startup, we compute latestCompletedXid = nextXid - 1. The current code
dodges this kind of accidentally: the checkpoint that happens at
startup is a "shutdown checkpoint" and thus skips logging a standby
snapshot, since a shutdown checkpoint is a sure indicator that there
are no running transactions. With the changes, the checkpoint at
startup happens after we've started allowing write transactions, and
thus a standby snapshot needs to be logged also. In the cases where
the end-of-recovery record was already being used, the problem could
have happened already, except for the fact that those cases involve a
standby promotion, which doesn't happen during initdb. I explored a
few possible ways of solving this problem.
The first thing I considered was replacing latestCompletedXid with a
name like incompleteXidHorizon. The idea is that, where
latestCompletedXid is the highest XID that is known to have committed
or aborted, incompleteXidHorizon would be the lowest XID such that all
known commits or aborts are for lower XIDs. In effect,
incompleteXidHorizon would be latestCompletedXid + 1. Since
latestCompletedXid is always normal except when it's 2,
incompleteXidHorizon would be normal in all cases. Initially this
seemed fairly promising, but it kind of fell down when I realized that
we copy latestCompletedXid into
ComputeXidHorizonsResult.latest_completed. That seemed to me to make
the consequences of the change a bit more far-reaching than I liked.
Also, it wasn't entirely clear to me that I wouldn't be introducing
any off-by-one errors into various wraparound calculations with this
approach.
The second thing I considered was skipping LogStandbySnapshot() during
initdb. There are two ways of doing this and neither of them seem that
great to me. Something that does work is to skip LogStandbySnapshot()
when in single user mode, but there is no particular reason why WAL
generated in single user mode couldn't be replayed on a standby, so
this doesn't seem great. It's too big a hammer for what we really
want, which is just to suppress this during initdb. Another way of
approaching it is to skip it in bootstrap mode, but that actually
doesn't work: initdb then fails during the post-bootstrapping step
rather than during bootstrapping. I thought about patching around that
by forcing the code that generates checkpoint records to forcibly
advance an XID of 3 to 4, but that seemed like working around the
problem from the wrong end.
So ... I decided that the best approach here seems to be to just skip
FirstNormalTransactionId and use FirstNormalTransactionId + 1 for the
first write transaction that the cluster ever processes. That's very
simple and doesn't seem likely to break anything else. On the downside
it seems a bit grotty, but I don't see anything better, and on the
whole, I think with this approach we come out substantially ahead.
0001 removes 3 times as many lines as it inserts, and 0002 saves a few
more lines of code.
Now, I still don't really know that there isn't some theoretical
difficulty here that makes this whole approach a non-starter, but I
also can't think of what it might be. If the promotion case, which has
used the end-of-recovery record for many years, is basically safe,
despite the fact that it switches TLIs, then it seems to me that the
crash recovery case, which doesn't have that complication, ought to be
safe too. But I might well be missing something, so if you see a
problem, please speak up!
--
Robert Haas
EDB: http://www.enterprisedb.com
Attachments:
[application/octet-stream] v4-0001-Remove-the-end-of-recovery-checkpoint-in-all-case.patch (19.4K, ../../CA+TgmoY+SJLTjma4Hfn1sA7S6CZAgbihYd=KzO6srd7Ut=XVBQ@mail.gmail.com/2-v4-0001-Remove-the-end-of-recovery-checkpoint-in-all-case.patch)
download | inline diff:
From ecfe3ee237ebd3f2c9b8281aef37877dbc7f43dd Mon Sep 17 00:00:00 2001
From: Robert Haas <[email protected]>
Date: Mon, 18 Apr 2022 15:40:12 -0400
Subject: [PATCH v4 1/2] Remove the end-of-recovery checkpoint in all cases.
For many years, we've been issuing a special end-of-recovery WAL
record rather than performing an end-of-recovery checkpoint when a
standby is promoted. This has the advantage of speeding up promotion.
However, it's advantageous to do this at the end of crash recovery as
well, and for the same reasons. Plus, it's actually simpler this way,
because having only one way to do something rather than two means we
need less code.
We now always request a checkpoint at the end of recovery. If we
crash again before that checkpoint completes, recovery will begin
from the previous checkpoint that we performed - or replayed. This
behavior is not new as far as archive recovery is concerned, but now
it can also happen for crash recovery.
At initdb time, we now initialize the nextXid counter to 4 rather
than to 3. The code for logging standby shapshots and handling them
on th standby can't handle 3, because we set latestCompleteXid =
nextXid - 1, and 2 is not a normal XID. This is arguably a preexisting
bug, but because we didn't log a standby snapshot when starting from
an end-of-recovery checkpoint, we happened not to ever hit the
problematic case.
---
src/backend/access/transam/xlog.c | 155 +++++------------------
src/backend/postmaster/checkpointer.c | 11 +-
src/backend/replication/logical/decode.c | 8 +-
src/backend/storage/buffer/bufmgr.c | 10 +-
src/include/access/xlog.h | 3 +-
src/include/access/xlog_internal.h | 2 +-
6 files changed, 46 insertions(+), 143 deletions(-)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 5eabd32cf6..6f67ffa3c3 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -665,7 +665,6 @@ static void UpdateLastRemovedPtr(char *filename);
static void ValidateXLOGDirectoryStructure(void);
static void CleanupBackupHistory(void);
static void UpdateMinRecoveryPoint(XLogRecPtr lsn, bool force);
-static bool PerformRecoveryXLogAction(void);
static void InitControlFile(uint64 sysidentifier);
static void WriteControlFile(void);
static void ReadControlFile(void);
@@ -2516,8 +2515,7 @@ XLogFlush(XLogRecPtr record)
* During REDO, we are reading not writing WAL. Therefore, instead of
* trying to flush the WAL, we should update minRecoveryPoint instead. We
* test XLogInsertAllowed(), not InRecovery, because we need checkpointer
- * to act this way too, and because when it tries to write the
- * end-of-recovery checkpoint, it should indeed flush.
+ * to act this way too.
*/
if (!XLogInsertAllowed())
{
@@ -2654,10 +2652,7 @@ XLogFlush(XLogRecPtr record)
* the bad page is encountered again during recovery then we would be
* unable to restart the database at all! (This scenario actually
* happened in the field several times with 7.1 releases.) As of 8.4, bad
- * LSNs encountered during recovery are UpdateMinRecoveryPoint's problem;
- * the only time we can reach here during recovery is while flushing the
- * end-of-recovery checkpoint record, and we don't expect that to have a
- * bad LSN.
+ * LSNs encountered during recovery are UpdateMinRecoveryPoint's problem.
*
* Note that for calls from xact.c, the ERROR will be promoted to PANIC
* since xact.c calls this routine inside a critical section. However,
@@ -4495,6 +4490,7 @@ BootStrapXLOG(void)
uint64 sysidentifier;
struct timeval tv;
pg_crc32c crc;
+ FullTransactionId starting_fxid;
/* allow ordinary WAL segment creation, like StartupXLOG() would */
LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
@@ -4523,6 +4519,17 @@ BootStrapXLOG(void)
page = (XLogPageHeader) TYPEALIGN(XLOG_BLCKSZ, buffer);
memset(page, 0, XLOG_BLCKSZ);
+ /*
+ * We set nextXid to FirstNormalTransactionId + 1, because when restarting
+ * we'll set latestCompletedXid to nextXid - 1, and we want that to be a
+ * normal XID in all cases. If it isn't, a number of functions, including
+ * GetRunningTransactionData() and ProcArrayApplyRecoveryInfo(), will
+ * fail assertions.
+ */
+ starting_fxid =
+ FullTransactionIdFromEpochAndXid(0, FirstNormalTransactionId);
+ FullTransactionIdAdvance(&starting_fxid);
+
/*
* Set up information for the initial checkpoint record
*
@@ -4534,8 +4541,7 @@ BootStrapXLOG(void)
checkPoint.ThisTimeLineID = BootstrapTimeLineID;
checkPoint.PrevTimeLineID = BootstrapTimeLineID;
checkPoint.fullPageWrites = fullPageWrites;
- checkPoint.nextXid =
- FullTransactionIdFromEpochAndXid(0, FirstNormalTransactionId);
+ checkPoint.nextXid = starting_fxid;
checkPoint.nextOid = FirstGenbkiObjectId;
checkPoint.nextMulti = FirstMultiXactId;
checkPoint.nextMultiOffset = 0;
@@ -4890,7 +4896,6 @@ StartupXLOG(void)
XLogRecPtr abortedRecPtr;
XLogRecPtr missingContrecPtr;
TransactionId oldestActiveXID;
- bool promoted = false;
/*
* We should have an aux process resource owner to use, and we should not
@@ -5546,10 +5551,10 @@ StartupXLOG(void)
UpdateFullPageWrites();
/*
- * Emit checkpoint or end-of-recovery record in XLOG, if required.
+ * Emit end-of-recovery record in XLOG, if required.
*/
if (performedWalRecovery)
- promoted = PerformRecoveryXLogAction();
+ CreateEndOfRecoveryRecord();
/*
* If any of the critical GUCs have changed, log them before we allow
@@ -5611,13 +5616,12 @@ StartupXLOG(void)
WalSndWakeup();
/*
- * If this was a promotion, request an (online) checkpoint now. This isn't
- * required for consistency, but the last restartpoint might be far back,
- * and in case of a crash, recovering from it might take a longer than is
- * appropriate now that we're not in standby mode anymore.
+ * Request an (online) checkpoint now. This isn't required for consistency,
+ * but the last restartpoint might be far back, and in case of a crash,
+ * recovering from it might take a longer than is appropriate now that
+ * we're not in standby mode anymore.
*/
- if (promoted)
- RequestCheckpoint(CHECKPOINT_FORCE);
+ RequestCheckpoint(CHECKPOINT_FORCE);
}
/*
@@ -5689,60 +5693,6 @@ ReachedEndOfBackup(XLogRecPtr EndRecPtr, TimeLineID tli)
LWLockRelease(ControlFileLock);
}
-/*
- * Perform whatever XLOG actions are necessary at end of REDO.
- *
- * The goal here is to make sure that we'll be able to recover properly if
- * we crash again. If we choose to write a checkpoint, we'll write a shutdown
- * checkpoint rather than an on-line one. This is not particularly critical,
- * but since we may be assigning a new TLI, using a shutdown checkpoint allows
- * us to have the rule that TLI only changes in shutdown checkpoints, which
- * allows some extra error checking in xlog_redo.
- */
-static bool
-PerformRecoveryXLogAction(void)
-{
- bool promoted = false;
-
- /*
- * Perform a checkpoint to update all our recovery activity to disk.
- *
- * Note that we write a shutdown checkpoint rather than an on-line one.
- * This is not particularly critical, but since we may be assigning a new
- * TLI, using a shutdown checkpoint allows us to have the rule that TLI
- * only changes in shutdown checkpoints, which allows some extra error
- * checking in xlog_redo.
- *
- * In promotion, only create a lightweight end-of-recovery record instead
- * of a full checkpoint. A checkpoint is requested later, after we're
- * fully out of recovery mode and already accepting queries.
- */
- if (ArchiveRecoveryRequested && IsUnderPostmaster &&
- PromoteIsTriggered())
- {
- promoted = true;
-
- /*
- * Insert a special WAL record to mark the end of recovery, since we
- * aren't doing a checkpoint. That means that the checkpointer process
- * may likely be in the middle of a time-smoothed restartpoint and
- * could continue to be for minutes after this. That sounds strange,
- * but the effect is roughly the same and it would be stranger to try
- * to come out of the restartpoint and then checkpoint. We request a
- * checkpoint later anyway, just for safety.
- */
- CreateEndOfRecoveryRecord();
- }
- else
- {
- RequestCheckpoint(CHECKPOINT_END_OF_RECOVERY |
- CHECKPOINT_IMMEDIATE |
- CHECKPOINT_WAIT);
- }
-
- return promoted;
-}
-
/*
* Is the system still in recovery?
*
@@ -6053,9 +6003,8 @@ LogCheckpointStart(int flags, bool restartpoint)
if (restartpoint)
ereport(LOG,
/* translator: the placeholders show checkpoint options */
- (errmsg("restartpoint starting:%s%s%s%s%s%s%s%s",
+ (errmsg("restartpoint starting:%s%s%s%s%s%s%s",
(flags & CHECKPOINT_IS_SHUTDOWN) ? " shutdown" : "",
- (flags & CHECKPOINT_END_OF_RECOVERY) ? " end-of-recovery" : "",
(flags & CHECKPOINT_IMMEDIATE) ? " immediate" : "",
(flags & CHECKPOINT_FORCE) ? " force" : "",
(flags & CHECKPOINT_WAIT) ? " wait" : "",
@@ -6065,9 +6014,8 @@ LogCheckpointStart(int flags, bool restartpoint)
else
ereport(LOG,
/* translator: the placeholders show checkpoint options */
- (errmsg("checkpoint starting:%s%s%s%s%s%s%s%s",
+ (errmsg("checkpoint starting:%s%s%s%s%s%s%s",
(flags & CHECKPOINT_IS_SHUTDOWN) ? " shutdown" : "",
- (flags & CHECKPOINT_END_OF_RECOVERY) ? " end-of-recovery" : "",
(flags & CHECKPOINT_IMMEDIATE) ? " immediate" : "",
(flags & CHECKPOINT_FORCE) ? " force" : "",
(flags & CHECKPOINT_WAIT) ? " wait" : "",
@@ -6219,7 +6167,7 @@ update_checkpoint_display(int flags, bool restartpoint, bool reset)
* pg_stat_activity to see the status of the checkpointer or the startup
* process.
*/
- if ((flags & (CHECKPOINT_END_OF_RECOVERY | CHECKPOINT_IS_SHUTDOWN)) == 0)
+ if ((flags & CHECKPOINT_IS_SHUTDOWN) == 0)
return;
if (reset)
@@ -6228,8 +6176,7 @@ update_checkpoint_display(int flags, bool restartpoint, bool reset)
{
char activitymsg[128];
- snprintf(activitymsg, sizeof(activitymsg), "performing %s%s%s",
- (flags & CHECKPOINT_END_OF_RECOVERY) ? "end-of-recovery " : "",
+ snprintf(activitymsg, sizeof(activitymsg), "performing %s%s",
(flags & CHECKPOINT_IS_SHUTDOWN) ? "shutdown " : "",
restartpoint ? "restartpoint" : "checkpoint");
set_ps_display(activitymsg);
@@ -6242,12 +6189,10 @@ update_checkpoint_display(int flags, bool restartpoint, bool reset)
*
* flags is a bitwise OR of the following:
* CHECKPOINT_IS_SHUTDOWN: checkpoint is for database shutdown.
- * CHECKPOINT_END_OF_RECOVERY: checkpoint is for end of WAL recovery.
* CHECKPOINT_IMMEDIATE: finish the checkpoint ASAP,
* ignoring checkpoint_completion_target parameter.
* CHECKPOINT_FORCE: force a checkpoint even if no XLOG activity has occurred
- * since the last one (implied by CHECKPOINT_IS_SHUTDOWN or
- * CHECKPOINT_END_OF_RECOVERY).
+ * since the last one (implied by CHECKPOINT_IS_SHUTDOWN).
* CHECKPOINT_FLUSH_ALL: also flush buffers of unlogged tables.
*
* Note: flags contains other bits, of interest here only for logging purposes.
@@ -6269,7 +6214,7 @@ update_checkpoint_display(int flags, bool restartpoint, bool reset)
void
CreateCheckPoint(int flags)
{
- bool shutdown;
+ bool shutdown = (flags & CHECKPOINT_IS_SHUTDOWN) != 0;
CheckPoint checkPoint;
XLogRecPtr recptr;
XLogSegNo _logSegNo;
@@ -6280,19 +6225,9 @@ CreateCheckPoint(int flags)
XLogRecPtr last_important_lsn;
VirtualTransactionId *vxids;
int nvxids;
- int oldXLogAllowed = 0;
-
- /*
- * An end-of-recovery checkpoint is really a shutdown checkpoint, just
- * issued at a different time.
- */
- if (flags & (CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_END_OF_RECOVERY))
- shutdown = true;
- else
- shutdown = false;
/* sanity check */
- if (RecoveryInProgress() && (flags & CHECKPOINT_END_OF_RECOVERY) == 0)
+ if (RecoveryInProgress())
elog(ERROR, "can't create a checkpoint during recovery");
/*
@@ -6358,8 +6293,7 @@ CreateCheckPoint(int flags)
* WAL activity requiring a checkpoint, skip it. The idea here is to
* avoid inserting duplicate checkpoints when the system is idle.
*/
- if ((flags & (CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_END_OF_RECOVERY |
- CHECKPOINT_FORCE)) == 0)
+ if ((flags & (CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_FORCE)) == 0)
{
if (last_important_lsn == ControlFile->checkPoint)
{
@@ -6371,19 +6305,8 @@ CreateCheckPoint(int flags)
}
}
- /*
- * An end-of-recovery checkpoint is created before anyone is allowed to
- * write WAL. To allow us to write the checkpoint record, temporarily
- * enable XLogInsertAllowed.
- */
- if (flags & CHECKPOINT_END_OF_RECOVERY)
- oldXLogAllowed = LocalSetXLogInsertAllowed();
-
checkPoint.ThisTimeLineID = XLogCtl->InsertTimeLineID;
- if (flags & CHECKPOINT_END_OF_RECOVERY)
- checkPoint.PrevTimeLineID = XLogCtl->PrevTimeLineID;
- else
- checkPoint.PrevTimeLineID = checkPoint.ThisTimeLineID;
+ checkPoint.PrevTimeLineID = checkPoint.ThisTimeLineID;
checkPoint.fullPageWrites = Insert->fullPageWrites;
@@ -6540,8 +6463,7 @@ CreateCheckPoint(int flags)
* allows us to reconstruct the state of running transactions during
* archive recovery, if required. Skip, if this info disabled.
*
- * If we are shutting down, or Startup process is completing crash
- * recovery we don't need to write running xact data.
+ * If we are shutting down, we don't need to write running xact data.
*/
if (!shutdown && XLogStandbyInfoActive())
LogStandbySnapshot();
@@ -6562,17 +6484,10 @@ CreateCheckPoint(int flags)
/*
* We mustn't write any new WAL after a shutdown checkpoint, or it will be
* overwritten at next startup. No-one should even try, this just allows
- * sanity-checking. In the case of an end-of-recovery checkpoint, we want
- * to just temporarily disable writing until the system has exited
- * recovery.
+ * sanity-checking.
*/
if (shutdown)
- {
- if (flags & CHECKPOINT_END_OF_RECOVERY)
- LocalXLogInsertAllowed = oldXLogAllowed;
- else
- LocalXLogInsertAllowed = 0; /* never again write WAL */
- }
+ LocalXLogInsertAllowed = 0; /* never again write WAL */
/*
* We now have ProcLastRecPtr = start of actual checkpoint record, recptr
@@ -7017,7 +6932,7 @@ CreateRestartPoint(int flags)
* Update pg_control, using current time. Check that it still shows
* DB_IN_ARCHIVE_RECOVERY state and an older checkpoint, else do nothing;
* this is a quick hack to make sure nothing really bad happens if somehow
- * we get here after the end-of-recovery checkpoint.
+ * we get here after end of recovery.
*/
LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
if (ControlFile->state == DB_IN_ARCHIVE_RECOVERY &&
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index c937c39f50..624c728d95 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -411,13 +411,6 @@ CheckpointerMain(void)
ConditionVariableBroadcast(&CheckpointerShmem->start_cv);
- /*
- * The end-of-recovery checkpoint is a real checkpoint that's
- * performed while we're still in recovery.
- */
- if (flags & CHECKPOINT_END_OF_RECOVERY)
- do_restartpoint = false;
-
/*
* We will warn if (a) too soon since last checkpoint (whatever
* caused it) and (b) somebody set the CHECKPOINT_CAUSE_XLOG flag
@@ -916,12 +909,10 @@ CheckpointerShmemInit(void)
*
* flags is a bitwise OR of the following:
* CHECKPOINT_IS_SHUTDOWN: checkpoint is for database shutdown.
- * CHECKPOINT_END_OF_RECOVERY: checkpoint is for end of WAL recovery.
* CHECKPOINT_IMMEDIATE: finish the checkpoint ASAP,
* ignoring checkpoint_completion_target parameter.
* CHECKPOINT_FORCE: force a checkpoint even if no XLOG activity has occurred
- * since the last one (implied by CHECKPOINT_IS_SHUTDOWN or
- * CHECKPOINT_END_OF_RECOVERY).
+ * since the last one (implied by CHECKPOINT_IS_SHUTDOWN).
* CHECKPOINT_WAIT: wait for completion before returning (otherwise,
* just signal checkpointer to do it, and return).
* CHECKPOINT_CAUSE_XLOG: checkpoint is requested due to xlog filling.
diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c
index 6303647fe0..de6849d083 100644
--- a/src/backend/replication/logical/decode.c
+++ b/src/backend/replication/logical/decode.c
@@ -349,10 +349,10 @@ standby_decode(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
* Abort all transactions that we keep track of, that are
* older than the record's oldestRunningXid. This is the most
* convenient spot for doing so since, in contrast to shutdown
- * or end-of-recovery checkpoints, we have information about
- * all running transactions which includes prepared ones,
- * while shutdown checkpoints just know that no non-prepared
- * transactions are in progress.
+ * recovery checkpoints, we have information about all running
+ * transactions which includes prepared ones, while shutdown
+ * checkpoints just know that no non-prepared transactions are
+ * in progress.
*/
ReorderBufferAbortOld(ctx->reorder, running->oldestRunningXid);
}
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index e02ea3a977..9ac42a9fd4 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -1933,10 +1933,9 @@ UnpinBuffer(BufferDesc *buf, bool fixOwner)
*
* This is called at checkpoint time to write out all dirty shared buffers.
* The checkpoint request flags should be passed in. If CHECKPOINT_IMMEDIATE
- * is set, we disable delays between writes; if CHECKPOINT_IS_SHUTDOWN,
- * CHECKPOINT_END_OF_RECOVERY or CHECKPOINT_FLUSH_ALL is set, we write even
- * unlogged buffers, which are otherwise skipped. The remaining flags
- * currently have no effect here.
+ * is set, we disable delays between writes; if CHECKPOINT_IS_SHUTDOWN
+ * or CHECKPOINT_FLUSH_ALL is set, we write even unlogged buffers, which are
+ * otherwise skipped. The remaining flags currently have no effect here.
*/
static void
BufferSync(int flags)
@@ -1962,8 +1961,7 @@ BufferSync(int flags)
* we write only permanent, dirty buffers. But at shutdown or end of
* recovery, we write all dirty buffers.
*/
- if (!((flags & (CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_END_OF_RECOVERY |
- CHECKPOINT_FLUSH_ALL))))
+ if (!((flags & (CHECKPOINT_IS_SHUTDOWN | CHECKPOINT_FLUSH_ALL))))
mask |= BM_PERMANENT;
/*
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index d9f2487a96..04091d8576 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -132,8 +132,7 @@ extern PGDLLIMPORT bool XLOG_DEBUG;
/* These directly affect the behavior of CreateCheckPoint and subsidiaries */
#define CHECKPOINT_IS_SHUTDOWN 0x0001 /* Checkpoint is for shutdown */
-#define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint, but
- * issued at end of WAL recovery */
+/* 0x0002 was CHECKPOINT_END_OF_RECOVERY, now unused */
#define CHECKPOINT_IMMEDIATE 0x0004 /* Do it without delays */
#define CHECKPOINT_FORCE 0x0008 /* Force even if no activity */
#define CHECKPOINT_FLUSH_ALL 0x0010 /* Flush all pages, including those
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index fae0bef8f5..b71f1eed90 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -258,7 +258,7 @@ typedef struct xl_overwrite_contrecord
TimestampTz overwrite_time;
} xl_overwrite_contrecord;
-/* End of recovery mark, when we don't do an END_OF_RECOVERY checkpoint */
+/* End of recovery mark, and possible TLI change */
typedef struct xl_end_of_recovery
{
TimestampTz end_time;
--
2.24.3 (Apple Git-128)
[application/octet-stream] v4-0002-Remove-previous-timeline-ID-from-checkpoint.patch (14.1K, ../../CA+TgmoY+SJLTjma4Hfn1sA7S6CZAgbihYd=KzO6srd7Ut=XVBQ@mail.gmail.com/3-v4-0002-Remove-previous-timeline-ID-from-checkpoint.patch)
download | inline diff:
From cb49c761f783d07067b7e7c1101a1b7aea0e6fe6 Mon Sep 17 00:00:00 2001
From: Robert Haas <[email protected]>
Date: Mon, 18 Apr 2022 16:01:13 -0400
Subject: [PATCH v4 2/2] Remove previous timeline ID from checkpoint.
Since recovery now always ends with an end-of-recovery record rather
than a checkpoint, a checkpoint never causes a timeline switch.
Therefore, it doesn't need to store a previous timeline ID and a
current timeline ID any more.
Note that this affects the signature of the SQL-callable function
pg_control_checkpoint().
---
doc/src/sgml/func.sgml | 5 --
src/backend/access/rmgrdesc/xlogdesc.c | 3 +-
src/backend/access/transam/xlog.c | 2 -
src/backend/access/transam/xlogrecovery.c | 32 +++++-------
src/backend/utils/misc/pg_controldata.c | 61 +++++++++++------------
src/bin/pg_controldata/pg_controldata.c | 2 -
src/bin/pg_resetwal/pg_resetwal.c | 4 --
src/include/catalog/pg_control.h | 4 +-
src/include/catalog/pg_proc.dat | 6 +--
9 files changed, 45 insertions(+), 74 deletions(-)
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 93ba39eff1..4c92e9e56d 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -27626,11 +27626,6 @@ SELECT collation for ('foo' COLLATE "de_DE");
<entry><type>integer</type></entry>
</row>
- <row>
- <entry><structfield>prev_timeline_id</structfield></entry>
- <entry><type>integer</type></entry>
- </row>
-
<row>
<entry><structfield>full_page_writes</structfield></entry>
<entry><type>boolean</type></entry>
diff --git a/src/backend/access/rmgrdesc/xlogdesc.c b/src/backend/access/rmgrdesc/xlogdesc.c
index c0dfea40c7..a3e29b043f 100644
--- a/src/backend/access/rmgrdesc/xlogdesc.c
+++ b/src/backend/access/rmgrdesc/xlogdesc.c
@@ -45,13 +45,12 @@ 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; 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",
LSN_FORMAT_ARGS(checkpoint->redo),
checkpoint->ThisTimeLineID,
- checkpoint->PrevTimeLineID,
checkpoint->fullPageWrites ? "true" : "false",
EpochFromFullTransactionId(checkpoint->nextXid),
XidFromFullTransactionId(checkpoint->nextXid),
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 6f67ffa3c3..c1784bb386 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4539,7 +4539,6 @@ BootStrapXLOG(void)
*/
checkPoint.redo = wal_segment_size + SizeOfXLogLongPHD;
checkPoint.ThisTimeLineID = BootstrapTimeLineID;
- checkPoint.PrevTimeLineID = BootstrapTimeLineID;
checkPoint.fullPageWrites = fullPageWrites;
checkPoint.nextXid = starting_fxid;
checkPoint.nextOid = FirstGenbkiObjectId;
@@ -6306,7 +6305,6 @@ CreateCheckPoint(int flags)
}
checkPoint.ThisTimeLineID = XLogCtl->InsertTimeLineID;
- checkPoint.PrevTimeLineID = checkPoint.ThisTimeLineID;
checkPoint.fullPageWrites = Insert->fullPageWrites;
diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c
index 39ef865ed9..14a3ee96a3 100644
--- a/src/backend/access/transam/xlogrecovery.c
+++ b/src/backend/access/transam/xlogrecovery.c
@@ -1833,36 +1833,28 @@ ApplyWalRecord(XLogReaderState *xlogreader, XLogRecord *record, TimeLineID *repl
*/
if (record->xl_rmid == RM_XLOG_ID)
{
- TimeLineID newReplayTLI = *replayTLI;
- TimeLineID prevReplayTLI = *replayTLI;
uint8 info = record->xl_info & ~XLR_INFO_MASK;
- if (info == XLOG_CHECKPOINT_SHUTDOWN)
- {
- CheckPoint checkPoint;
-
- memcpy(&checkPoint, XLogRecGetData(xlogreader), sizeof(CheckPoint));
- newReplayTLI = checkPoint.ThisTimeLineID;
- prevReplayTLI = checkPoint.PrevTimeLineID;
- }
- else if (info == XLOG_END_OF_RECOVERY)
+ if (info == XLOG_END_OF_RECOVERY)
{
xl_end_of_recovery xlrec;
+ TimeLineID newReplayTLI;
+ TimeLineID prevReplayTLI;
memcpy(&xlrec, XLogRecGetData(xlogreader), sizeof(xl_end_of_recovery));
newReplayTLI = xlrec.ThisTimeLineID;
prevReplayTLI = xlrec.PrevTimeLineID;
- }
- if (newReplayTLI != *replayTLI)
- {
- /* Check that it's OK to switch to this TLI */
- checkTimeLineSwitch(xlogreader->EndRecPtr,
- newReplayTLI, prevReplayTLI, *replayTLI);
+ if (newReplayTLI != *replayTLI)
+ {
+ /* Check that it's OK to switch to this TLI */
+ checkTimeLineSwitch(xlogreader->EndRecPtr,
+ newReplayTLI, prevReplayTLI, *replayTLI);
- /* Following WAL records should be run with new TLI */
- *replayTLI = newReplayTLI;
- switchedTLI = true;
+ /* Following WAL records should be run with new TLI */
+ *replayTLI = newReplayTLI;
+ switchedTLI = true;
+ }
}
}
diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c
index 781f8b8758..c30f380d07 100644
--- a/src/backend/utils/misc/pg_controldata.c
+++ b/src/backend/utils/misc/pg_controldata.c
@@ -101,33 +101,31 @@ pg_control_checkpoint(PG_FUNCTION_ARGS)
TEXTOID, -1, 0);
TupleDescInitEntry(tupdesc, (AttrNumber) 4, "timeline_id",
INT4OID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 5, "prev_timeline_id",
- INT4OID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 6, "full_page_writes",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 5, "full_page_writes",
BOOLOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 7, "next_xid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 6, "next_xid",
TEXTOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 8, "next_oid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 7, "next_oid",
OIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 9, "next_multixact_id",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 8, "next_multixact_id",
XIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 10, "next_multi_offset",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 9, "next_multi_offset",
XIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 11, "oldest_xid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 10, "oldest_xid",
XIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 12, "oldest_xid_dbid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 11, "oldest_xid_dbid",
OIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 13, "oldest_active_xid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 12, "oldest_active_xid",
XIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 14, "oldest_multi_xid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 13, "oldest_multi_xid",
XIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 15, "oldest_multi_dbid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 14, "oldest_multi_dbid",
OIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 16, "oldest_commit_ts_xid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 15, "oldest_commit_ts_xid",
XIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 17, "newest_commit_ts_xid",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 16, "newest_commit_ts_xid",
XIDOID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) 18, "checkpoint_time",
+ TupleDescInitEntry(tupdesc, (AttrNumber) 17, "checkpoint_time",
TIMESTAMPTZOID, -1, 0);
tupdesc = BlessTupleDesc(tupdesc);
@@ -158,50 +156,47 @@ pg_control_checkpoint(PG_FUNCTION_ARGS)
values[3] = Int32GetDatum(ControlFile->checkPointCopy.ThisTimeLineID);
nulls[3] = false;
- values[4] = Int32GetDatum(ControlFile->checkPointCopy.PrevTimeLineID);
+ values[4] = BoolGetDatum(ControlFile->checkPointCopy.fullPageWrites);
nulls[4] = false;
- values[5] = BoolGetDatum(ControlFile->checkPointCopy.fullPageWrites);
- nulls[5] = false;
-
- values[6] = CStringGetTextDatum(psprintf("%u:%u",
+ values[5] = CStringGetTextDatum(psprintf("%u:%u",
EpochFromFullTransactionId(ControlFile->checkPointCopy.nextXid),
XidFromFullTransactionId(ControlFile->checkPointCopy.nextXid)));
+ nulls[5] = false;
+
+ values[6] = ObjectIdGetDatum(ControlFile->checkPointCopy.nextOid);
nulls[6] = false;
- values[7] = ObjectIdGetDatum(ControlFile->checkPointCopy.nextOid);
+ values[7] = TransactionIdGetDatum(ControlFile->checkPointCopy.nextMulti);
nulls[7] = false;
- values[8] = TransactionIdGetDatum(ControlFile->checkPointCopy.nextMulti);
+ values[8] = TransactionIdGetDatum(ControlFile->checkPointCopy.nextMultiOffset);
nulls[8] = false;
- values[9] = TransactionIdGetDatum(ControlFile->checkPointCopy.nextMultiOffset);
+ values[9] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestXid);
nulls[9] = false;
- values[10] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestXid);
+ values[10] = ObjectIdGetDatum(ControlFile->checkPointCopy.oldestXidDB);
nulls[10] = false;
- values[11] = ObjectIdGetDatum(ControlFile->checkPointCopy.oldestXidDB);
+ values[11] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestActiveXid);
nulls[11] = false;
- values[12] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestActiveXid);
+ values[12] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestMulti);
nulls[12] = false;
- values[13] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestMulti);
+ values[13] = ObjectIdGetDatum(ControlFile->checkPointCopy.oldestMultiDB);
nulls[13] = false;
- values[14] = ObjectIdGetDatum(ControlFile->checkPointCopy.oldestMultiDB);
+ values[14] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestCommitTsXid);
nulls[14] = false;
- values[15] = TransactionIdGetDatum(ControlFile->checkPointCopy.oldestCommitTsXid);
+ values[15] = TransactionIdGetDatum(ControlFile->checkPointCopy.newestCommitTsXid);
nulls[15] = false;
- values[16] = TransactionIdGetDatum(ControlFile->checkPointCopy.newestCommitTsXid);
+ values[16] = TimestampTzGetDatum(time_t_to_timestamptz(ControlFile->checkPointCopy.time));
nulls[16] = false;
- values[17] = TimestampTzGetDatum(time_t_to_timestamptz(ControlFile->checkPointCopy.time));
- nulls[17] = false;
-
htup = heap_form_tuple(tupdesc, values, nulls);
PG_RETURN_DATUM(HeapTupleGetDatum(htup));
diff --git a/src/bin/pg_controldata/pg_controldata.c b/src/bin/pg_controldata/pg_controldata.c
index c390ec51ce..56dc8d0031 100644
--- a/src/bin/pg_controldata/pg_controldata.c
+++ b/src/bin/pg_controldata/pg_controldata.c
@@ -243,8 +243,6 @@ main(int argc, char *argv[])
xlogfilename);
printf(_("Latest checkpoint's TimeLineID: %u\n"),
ControlFile->checkPointCopy.ThisTimeLineID);
- printf(_("Latest checkpoint's PrevTimeLineID: %u\n"),
- 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"),
diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c
index d4772a2965..2e2f35bf5c 100644
--- a/src/bin/pg_resetwal/pg_resetwal.c
+++ b/src/bin/pg_resetwal/pg_resetwal.c
@@ -444,10 +444,7 @@ main(int argc, char *argv[])
ControlFile.checkPointCopy.nextMultiOffset = set_mxoff;
if (minXlogTli > ControlFile.checkPointCopy.ThisTimeLineID)
- {
ControlFile.checkPointCopy.ThisTimeLineID = minXlogTli;
- ControlFile.checkPointCopy.PrevTimeLineID = minXlogTli;
- }
if (set_wal_segsize != 0)
ControlFile.xlog_seg_size = WalSegSz;
@@ -650,7 +647,6 @@ GuessControlValues(void)
ControlFile.checkPointCopy.redo = SizeOfXLogLongPHD;
ControlFile.checkPointCopy.ThisTimeLineID = 1;
- ControlFile.checkPointCopy.PrevTimeLineID = 1;
ControlFile.checkPointCopy.fullPageWrites = false;
ControlFile.checkPointCopy.nextXid =
FullTransactionIdFromEpochAndXid(0, FirstNormalTransactionId);
diff --git a/src/include/catalog/pg_control.h b/src/include/catalog/pg_control.h
index 06368e2366..b0da5cb1b5 100644
--- a/src/include/catalog/pg_control.h
+++ b/src/include/catalog/pg_control.h
@@ -22,7 +22,7 @@
/* Version identifier for this pg_control format */
-#define PG_CONTROL_VERSION 1300
+#define PG_CONTROL_VERSION 1600
/* Nonce key length, see below */
#define MOCK_AUTH_NONCE_LEN 32
@@ -37,8 +37,6 @@ typedef struct CheckPoint
XLogRecPtr redo; /* next RecPtr available when we began to
* create CheckPoint (i.e. REDO start point) */
TimeLineID ThisTimeLineID; /* current TLI */
- TimeLineID PrevTimeLineID; /* previous TLI, if this record begins a new
- * timeline (equals ThisTimeLineID otherwise) */
bool fullPageWrites; /* current full_page_writes */
FullTransactionId nextXid; /* next free transaction ID */
Oid nextOid; /* next free OID */
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 6d378ff785..c2bd6f0801 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -11711,9 +11711,9 @@
descr => 'pg_controldata checkpoint state information as a function',
proname => 'pg_control_checkpoint', provolatile => 'v',
prorettype => 'record', proargtypes => '',
- proallargtypes => '{pg_lsn,pg_lsn,text,int4,int4,bool,text,oid,xid,xid,xid,oid,xid,xid,oid,xid,xid,timestamptz}',
- proargmodes => '{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}',
- proargnames => '{checkpoint_lsn,redo_lsn,redo_wal_file,timeline_id,prev_timeline_id,full_page_writes,next_xid,next_oid,next_multixact_id,next_multi_offset,oldest_xid,oldest_xid_dbid,oldest_active_xid,oldest_multi_xid,oldest_multi_dbid,oldest_commit_ts_xid,newest_commit_ts_xid,checkpoint_time}',
+ proallargtypes => '{pg_lsn,pg_lsn,text,int4,bool,text,oid,xid,xid,xid,oid,xid,xid,oid,xid,xid,timestamptz}',
+ proargmodes => '{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}',
+ proargnames => '{checkpoint_lsn,redo_lsn,redo_wal_file,timeline_id,full_page_writes,next_xid,next_oid,next_multixact_id,next_multi_offset,oldest_xid,oldest_xid_dbid,oldest_active_xid,oldest_multi_xid,oldest_multi_dbid,oldest_commit_ts_xid,newest_commit_ts_xid,checkpoint_time}',
prosrc => 'pg_control_checkpoint' },
{ oid => '3443',
--
2.24.3 (Apple Git-128)
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2022-04-18 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06 00:58 [PATCH v9 5/8] Invalidate parent indexes Justin Pryzby <[email protected]>
2022-01-16 04:52 Re: using an end-of-recovery record in all cases Julien Rouhaud <[email protected]>
2022-04-18 20:44 ` Re: using an end-of-recovery record in all cases Robert Haas <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox