Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8f7c8e2

Browse files
committed
Further simplify a bit of logic in StartupXLOG().
Commit7ff23c6 left us with twoidentical cases. Collapse them.Author: Robert Haas <robertmhaas@gmail.com>Discussion:https://postgr.es/m/CA%2BhUKGJ8NRsqgkZEnsnRc2MFROBV-jCnacbYvtpptK2A9YYp9Q%40mail.gmail.com
1 parentdb632fb commit8f7c8e2

File tree

1 file changed

+14
-20
lines changed
  • src/backend/access/transam

1 file changed

+14
-20
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7890,28 +7890,22 @@ StartupXLOG(void)
78907890
* after we're fully out of recovery mode and already accepting
78917891
* queries.
78927892
*/
7893-
if (ArchiveRecoveryRequested&&IsUnderPostmaster)
7893+
if (ArchiveRecoveryRequested&&IsUnderPostmaster&&
7894+
LocalPromoteIsTriggered)
78947895
{
7895-
if (LocalPromoteIsTriggered)
7896-
{
7897-
promoted= true;
7896+
promoted= true;
78987897

7899-
/*
7900-
* Insert a special WAL record to mark the end of recovery,
7901-
* since we aren't doing a checkpoint. That means that the
7902-
* checkpointer process may likely be in the middle of a
7903-
* time-smoothed restartpoint and could continue to be for
7904-
* minutes after this. That sounds strange, but the effect is
7905-
* roughly the same and it would be stranger to try to come
7906-
* out of the restartpoint and then checkpoint. We request a
7907-
* checkpoint later anyway, just for safety.
7908-
*/
7909-
CreateEndOfRecoveryRecord();
7910-
}
7911-
else
7912-
RequestCheckpoint(CHECKPOINT_END_OF_RECOVERY |
7913-
CHECKPOINT_IMMEDIATE |
7914-
CHECKPOINT_WAIT);
7898+
/*
7899+
* Insert a special WAL record to mark the end of recovery, since
7900+
* we aren't doing a checkpoint. That means that the checkpointer
7901+
* process may likely be in the middle of a time-smoothed
7902+
* restartpoint and could continue to be for minutes after this.
7903+
* That sounds strange, but the effect is roughly the same and it
7904+
* would be stranger to try to come out of the restartpoint and
7905+
* then checkpoint. We request a checkpoint later anyway, just for
7906+
* safety.
7907+
*/
7908+
CreateEndOfRecoveryRecord();
79157909
}
79167910
else
79177911
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp