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

Commit1eadfbd

Browse files
committed
Revert "Disable STARTUP_PROGRESS_TIMEOUT in standby mode."
This reverts commit98e7234. Iforgot that we're about to wrap a release, and this fix isn'tcritical enough to justify committing it right before we wrapa release.Discussion:http://postgr.es/m/2676424.1675700113@sss.pgh.pa.us
1 parent98e7234 commit1eadfbd

File tree

3 files changed

+6
-51
lines changed

3 files changed

+6
-51
lines changed

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

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ static bool recoveryStopAfter;
383383
/* prototypes for local functions */
384384
staticvoidApplyWalRecord(XLogReaderState*xlogreader,XLogRecord*record,TimeLineID*replayTLI);
385385

386-
staticvoidEnableStandbyMode(void);
387386
staticvoidreadRecoverySignalFile(void);
388387
staticvoidvalidateRecoveryParameters(void);
389388
staticboolread_backup_label(XLogRecPtr*checkPointLoc,
@@ -468,24 +467,6 @@ XLogRecoveryShmemInit(void)
468467
ConditionVariableInit(&XLogRecoveryCtl->recoveryNotPausedCV);
469468
}
470469

471-
/*
472-
* A thin wrapper to enable StandbyMode and do other preparatory work as
473-
* needed.
474-
*/
475-
staticvoid
476-
EnableStandbyMode(void)
477-
{
478-
StandbyMode= true;
479-
480-
/*
481-
* To avoid server log bloat, we don't report recovery progress in a
482-
* standby as it will always be in recovery unless promoted. We disable
483-
* startup progress timeout in standby mode to avoid calling
484-
* startup_progress_timeout_handler() unnecessarily.
485-
*/
486-
disable_startup_progress_timeout();
487-
}
488-
489470
/*
490471
* Prepare the system for WAL recovery, if needed.
491472
*
@@ -619,7 +600,7 @@ InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdown_ptr,
619600
*/
620601
InArchiveRecovery= true;
621602
if (StandbyModeRequested)
622-
EnableStandbyMode();
603+
StandbyMode= true;
623604

624605
/*
625606
* When a backup_label file is present, we want to roll forward from
@@ -756,7 +737,7 @@ InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdown_ptr,
756737
{
757738
InArchiveRecovery= true;
758739
if (StandbyModeRequested)
759-
EnableStandbyMode();
740+
StandbyMode= true;
760741
}
761742

762743
/* Get the last valid checkpoint record. */
@@ -3134,7 +3115,7 @@ ReadRecord(XLogPrefetcher *xlogprefetcher, int emode,
31343115
(errmsg_internal("reached end of WAL in pg_wal, entering archive recovery")));
31353116
InArchiveRecovery= true;
31363117
if (StandbyModeRequested)
3137-
EnableStandbyMode();
3118+
StandbyMode= true;
31383119

31393120
SwitchIntoArchiveRecovery(xlogreader->EndRecPtr,replayTLI);
31403121
minRecoveryPoint=xlogreader->EndRecPtr;

‎src/backend/postmaster/startup.c

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -314,51 +314,27 @@ startup_progress_timeout_handler(void)
314314
startup_progress_timer_expired= true;
315315
}
316316

317-
void
318-
disable_startup_progress_timeout(void)
319-
{
320-
/* Feature is disabled. */
321-
if (log_startup_progress_interval==0)
322-
return;
323-
324-
disable_timeout(STARTUP_PROGRESS_TIMEOUT, false);
325-
startup_progress_timer_expired= false;
326-
}
327-
328317
/*
329318
* Set the start timestamp of the current operation and enable the timeout.
330319
*/
331320
void
332-
enable_startup_progress_timeout(void)
321+
begin_startup_progress_phase(void)
333322
{
334323
TimestampTzfin_time;
335324

336325
/* Feature is disabled. */
337326
if (log_startup_progress_interval==0)
338327
return;
339328

329+
disable_timeout(STARTUP_PROGRESS_TIMEOUT, false);
330+
startup_progress_timer_expired= false;
340331
startup_progress_phase_start_time=GetCurrentTimestamp();
341332
fin_time=TimestampTzPlusMilliseconds(startup_progress_phase_start_time,
342333
log_startup_progress_interval);
343334
enable_timeout_every(STARTUP_PROGRESS_TIMEOUT,fin_time,
344335
log_startup_progress_interval);
345336
}
346337

347-
/*
348-
* A thin wrapper to first disable and then enable the startup progress
349-
* timeout.
350-
*/
351-
void
352-
begin_startup_progress_phase(void)
353-
{
354-
/* Feature is disabled. */
355-
if (log_startup_progress_interval==0)
356-
return;
357-
358-
disable_startup_progress_timeout();
359-
enable_startup_progress_timeout();
360-
}
361-
362338
/*
363339
* Report whether startup progress timeout has occurred. Reset the timer flag
364340
* if it did, set the elapsed time to the out parameters and return true,

‎src/include/postmaster/startup.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ extern void PostRestoreCommand(void);
3232
externboolIsPromoteSignaled(void);
3333
externvoidResetPromoteSignaled(void);
3434

35-
externvoidenable_startup_progress_timeout(void);
36-
externvoiddisable_startup_progress_timeout(void);
3735
externvoidbegin_startup_progress_phase(void);
3836
externvoidstartup_progress_timeout_handler(void);
3937
externboolhas_startup_progress_timeout_expired(long*secs,int*usecs);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp