@@ -7890,28 +7890,22 @@ StartupXLOG(void)
7890
7890
* after we're fully out of recovery mode and already accepting
7891
7891
* queries.
7892
7892
*/
7893
- if (ArchiveRecoveryRequested && IsUnderPostmaster )
7893
+ if (ArchiveRecoveryRequested && IsUnderPostmaster &&
7894
+ LocalPromoteIsTriggered )
7894
7895
{
7895
- if (LocalPromoteIsTriggered )
7896
- {
7897
- promoted = true;
7896
+ promoted = true;
7898
7897
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 ();
7915
7909
}
7916
7910
else
7917
7911
{
0 commit comments