Skip to content

Commit 91fca4b

Browse files
committed
Demote variable from global to local
recoveryDelayUntilTime was introduced by commit 36da3cf as a global because its method of operation was devilishly intrincate. Commit c945af8 removed all that complexity and could have turned it into a local variable, but didn't. Do so now. Discussion: https://postgr.es/m/20191213200751.GA10731@alvherre.pgsql Reviewed-by: Michaël Paquier, Daniel Gustafsson
1 parent 741b884 commit 91fca4b

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
const char *recoveryTargetName;
278278
XLogRecPtr recoveryTargetLSN;
279279
int recovery_min_apply_delay = 0;
280-
TimestampTz recoveryDelayUntilTime;
281280

282281
/* options formerly taken from recovery.conf for XLOG streaming */
283282
bool StandbyModeRequested = false;
@@ -5970,6 +5969,7 @@ recoveryApplyDelay(XLogReaderState *record)
59705969
{
59715970
uint8 xact_info;
59725971
TimestampTz xtime;
5972+
TimestampTz delayUntil;
59735973
long secs;
59745974
int microsecs;
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy