@ -277,7 +277,6 @@ static TimestampTz recoveryTargetTime;
const char * recoveryTargetName ;
const char * recoveryTargetName ;
XLogRecPtr recoveryTargetLSN ;
XLogRecPtr recoveryTargetLSN ;
int recovery_min_apply_delay = 0 ;
int recovery_min_apply_delay = 0 ;
TimestampTz recoveryDelayUntilTime ;
/* options formerly taken from recovery.conf for XLOG streaming */
/* options formerly taken from recovery.conf for XLOG streaming */
bool StandbyModeRequested = false ;
bool StandbyModeRequested = false ;
@ -5970,6 +5969,7 @@ recoveryApplyDelay(XLogReaderState *record)
{
{
uint8 xact_info ;
uint8 xact_info ;
TimestampTz xtime ;
TimestampTz xtime ;
TimestampTz delayUntil ;
long secs ;
long secs ;
int microsecs ;
int microsecs ;
@ -6005,15 +6005,13 @@ recoveryApplyDelay(XLogReaderState *record)
if ( ! getRecordTimestamp ( record , & xtime ) )
if ( ! getRecordTimestamp ( record , & xtime ) )
return false ;
return false ;
recoveryDelayUntilTime =
delayUntil = TimestampTzPlusMilliseconds ( xtime , recovery_min_apply_delay ) ;
TimestampTzPlusMilliseconds ( xtime , recovery_min_apply_delay ) ;
/*
/*
* Exit without arming the latch if it ' s already past time to apply this
* Exit without arming the latch if it ' s already past time to apply this
* record
* record
*/
*/
TimestampDifference ( GetCurrentTimestamp ( ) , recoveryDelayUntilTime ,
TimestampDifference ( GetCurrentTimestamp ( ) , delayUntil , & secs , & microsecs ) ;
& secs , & microsecs ) ;
if ( secs < = 0 & & microsecs < = 0 )
if ( secs < = 0 & & microsecs < = 0 )
return false ;
return false ;
@ -6028,10 +6026,9 @@ recoveryApplyDelay(XLogReaderState *record)
break ;
break ;
/*
/*
* Wait for difference between GetCurrentTimestamp ( ) and
* Wait for difference between GetCurrentTimestamp ( ) and delayUntil
* recoveryDelayUntilTime
*/
*/
TimestampDifference ( GetCurrentTimestamp ( ) , recoveryDelayUntilTime ,
TimestampDifference ( GetCurrentTimestamp ( ) , delayUntil ,
& secs , & microsecs ) ;
& secs , & microsecs ) ;
/*
/*