Skip to content

Commit 2d1c7c8

Browse files
author
Commitfest Bot
committed
[CF 6043] v6 - Checkpointer write combining
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/6043 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAAKRu_atZuU3gYY6hVVuvqDW+mfXM+fCWCyYODbZPesxyr=y6g@mail.gmail.com Author(s): Melanie Plageman
2 parents 88824e6 + f5452ef commit 2d1c7c8

File tree

8 files changed

+953
-181
lines changed

8 files changed

+953
-181
lines changed

src/backend/access/transam/xlog.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,21 +3102,26 @@ XLogBackgroundFlush(void)
31023102
}
31033103

31043104
/*
3105-
* Test whether XLOG data has been flushed up to (at least) the given position.
3105+
* Test whether XLOG data has been flushed up to (at least) the given position
3106+
* or whether the minimum recovery point is updated past the given position.
31063107
*
3107-
* Returns true if a flush is still needed. (It may be that someone else
3108-
* is already in process of flushing that far, however.)
3108+
* Returns true if a flush is still needed or if the minimum recovery point
3109+
* must be updated.
3110+
*
3111+
* It is possible that someone else is already in the process of flushing that
3112+
* far or updating the minimum recovery point that far.
31093113
*/
31103114
bool
31113115
XLogNeedsFlush(XLogRecPtr record)
31123116
{
31133117
/*
3114-
* During recovery, we don't flush WAL but update minRecoveryPoint
3115-
* instead. So "needs flush" is taken to mean whether minRecoveryPoint
3116-
* would need to be updated.
3118+
* During recovery, when WAL inserts are forbidden, "needs flush" is taken
3119+
* to mean whether minRecoveryPoint would need to be updated.
31173120
*/
3118-
if (RecoveryInProgress())
3121+
if (!XLogInsertAllowed())
31193122
{
3123+
Assert(RecoveryInProgress());
3124+
31203125
/*
31213126
* An invalid minRecoveryPoint means that we need to recover all the
31223127
* WAL, i.e., we're doing crash recovery. We never modify the control

0 commit comments

Comments
 (0)