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

Commit91fca4b

Browse files
committed
Demote variable from global to local
recoveryDelayUntilTime was introduced by commit36da3cf as a globalbecause its method of operation was devilishly intrincate. Commitc945af8 removed all that complexity and could have turned it into alocal variable, but didn't. Do so now.Discussion:https://postgr.es/m/20191213200751.GA10731@alvherre.pgsqlReviewed-by: Michaël Paquier, Daniel Gustafsson
1 parent741b884 commit91fca4b

File tree

1 file changed

+5
-8
lines changed
  • src/backend/access/transam

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ static TimestampTz recoveryTargetTime;
277277
constchar*recoveryTargetName;
278278
XLogRecPtrrecoveryTargetLSN;
279279
intrecovery_min_apply_delay=0;
280-
TimestampTzrecoveryDelayUntilTime;
281280

282281
/* options formerly taken from recovery.conf for XLOG streaming */
283282
boolStandbyModeRequested= false;
@@ -5970,6 +5969,7 @@ recoveryApplyDelay(XLogReaderState *record)
59705969
{
59715970
uint8xact_info;
59725971
TimestampTzxtime;
5972+
TimestampTzdelayUntil;
59735973
longsecs;
59745974
intmicrosecs;
59755975

@@ -6005,15 +6005,13 @@ recoveryApplyDelay(XLogReaderState *record)
60056005
if (!getRecordTimestamp(record,&xtime))
60066006
return false;
60076007

6008-
recoveryDelayUntilTime=
6009-
TimestampTzPlusMilliseconds(xtime,recovery_min_apply_delay);
6008+
delayUntil=TimestampTzPlusMilliseconds(xtime,recovery_min_apply_delay);
60106009

60116010
/*
60126011
* Exit without arming the latch if it's already past time to apply this
60136012
* record
60146013
*/
6015-
TimestampDifference(GetCurrentTimestamp(),recoveryDelayUntilTime,
6016-
&secs,&microsecs);
6014+
TimestampDifference(GetCurrentTimestamp(),delayUntil,&secs,&microsecs);
60176015
if (secs <=0&&microsecs <=0)
60186016
return false;
60196017

@@ -6028,10 +6026,9 @@ recoveryApplyDelay(XLogReaderState *record)
60286026
break;
60296027

60306028
/*
6031-
* Wait for difference between GetCurrentTimestamp() and
6032-
* recoveryDelayUntilTime
6029+
* Wait for difference between GetCurrentTimestamp() and delayUntil
60336030
*/
6034-
TimestampDifference(GetCurrentTimestamp(),recoveryDelayUntilTime,
6031+
TimestampDifference(GetCurrentTimestamp(),delayUntil,
60356032
&secs,&microsecs);
60366033

60376034
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp