Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dffde5b

Browse files
committed
Fix defects in PrepareForIncrementalBackup.
Swap the arguments to TimestampDifferenceMilliseconds so that we get a positive answer instead of zero. Then use the result of that computation instead of ignoring it. Per reports from Alexander Lakhin. Discussion: http://postgr.es/m/8b686764-7ac1-74c3-70f9-b64685a2535f@gmail.com
1 parent 8ce5aef commit dffde5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/backup/basebackup_incremental.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,12 @@ PrepareForIncrementalBackup(IncrementalBackupInfo *ib,
436436
* drifting to something that is not a multiple of ten.
437437
*/
438438
timeout_in_ms -=
439-
TimestampDifferenceMilliseconds(current_time, initial_time) %
439+
TimestampDifferenceMilliseconds(initial_time, current_time) %
440440
timeout_in_ms;
441441

442442
/* Wait for up to 10 seconds. */
443443
summarized_lsn = WaitForWalSummarization(backup_state->startpoint,
444-
10000, &pending_lsn);
444+
timeout_in_ms, &pending_lsn);
445445

446446
/* If WAL summarization has progressed sufficiently, stop waiting. */
447447
if (summarized_lsn >= backup_state->startpoint)

0 commit comments

Comments
 (0)