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

Commit87cec51

Browse files
committed
Don't delay replication for less than recovery_min_apply_delay's resolution.
Recovery delays are implemented by waiting on a latch, and latches takemilliseconds as a parameter. The required amount of waiting was computedusing microsecond resolution though and the wait loop's abort conditionwas checking the delay in microseconds as well. This could lead toshort spurts of busy looping when the overall wait time was below amillisecond, but above 0 microseconds.Instead just formulate the wait loop's abort condition in millisecondgranularity as well. Given that that's recovery_min_apply_delayresolution, it seems harmless to not wait for less than a millisecond.Backpatch to 9.4 where recovery_min_apply_delay was introduced.Discussion: 20150323141819.GH26995@alap3.anarazel.de
1 parenta1105c3 commit87cec51

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5572,7 +5572,8 @@ recoveryApplyDelay(XLogReaderState *record)
55725572
TimestampDifference(GetCurrentTimestamp(),recoveryDelayUntilTime,
55735573
&secs,&microsecs);
55745574

5575-
if (secs <=0&&microsecs <=0)
5575+
/* NB: We're ignoring waits below min_apply_delay's resolution. */
5576+
if (secs <=0&&microsecs /1000 <=0)
55765577
break;
55775578

55785579
elog(DEBUG2,"recovery apply delay %ld seconds, %d milliseconds",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp