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

Commitf83d80e

Browse files
committed
Refresh apply delay on reload of recovery_min_apply_delay at recovery
This commit ensures that the wait interval in the replay delay loopwaiting for an amount of time defined by recovery_min_apply_delay iscorrectly handled on reload, recalculating the delay if this GUC valueis updated, based on the timestamp of the commit record being replayed.The previous behavior would be problematic for example with replaystill waiting even if the delay got reduced or just cancelled. If theapply delay was increased to a larger value, the wait would have justrespected the old value set, finishing earlier.Author: Soumyadeep Chakraborty, Ashwin AgrawalReviewed-by: Kyotaro Horiguchi, Michael PaquierDiscussion:https://postgr.es/m/CAE-ML+93zfr-HLN8OuxF0BjpWJ17O5dv1eMvSE5jsj9jpnAXZA@mail.gmail.comBackpatch-through: 9.6
1 parent4ffbd55 commitf83d80e

File tree

1 file changed

+11
-2
lines changed
  • src/backend/access/transam

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6205,14 +6205,23 @@ recoveryApplyDelay(XLogReaderState *record)
62056205
{
62066206
ResetLatch(&XLogCtl->recoveryWakeupLatch);
62076207

6208-
/* might change the trigger file's location */
6208+
/*
6209+
* This might change recovery_min_apply_delay or the trigger file's
6210+
* location.
6211+
*/
62096212
HandleStartupProcInterrupts();
62106213

62116214
if (CheckForStandbyTrigger())
62126215
break;
62136216

62146217
/*
6215-
* Wait for difference between GetCurrentTimestamp() and delayUntil
6218+
* Recalculate delayUntil as recovery_min_apply_delay could have
6219+
* changed while waiting in this loop.
6220+
*/
6221+
delayUntil=TimestampTzPlusMilliseconds(xtime,recovery_min_apply_delay);
6222+
6223+
/*
6224+
* Wait for difference between GetCurrentTimestamp() and delayUntil.
62166225
*/
62176226
msecs=TimestampDifferenceMilliseconds(GetCurrentTimestamp(),
62186227
delayUntil);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp