mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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
This commit is contained in:
@ -436,12 +436,12 @@ PrepareForIncrementalBackup(IncrementalBackupInfo *ib,
|
|||||||
* drifting to something that is not a multiple of ten.
|
* drifting to something that is not a multiple of ten.
|
||||||
*/
|
*/
|
||||||
timeout_in_ms -=
|
timeout_in_ms -=
|
||||||
TimestampDifferenceMilliseconds(current_time, initial_time) %
|
TimestampDifferenceMilliseconds(initial_time, current_time) %
|
||||||
timeout_in_ms;
|
timeout_in_ms;
|
||||||
|
|
||||||
/* Wait for up to 10 seconds. */
|
/* Wait for up to 10 seconds. */
|
||||||
summarized_lsn = WaitForWalSummarization(backup_state->startpoint,
|
summarized_lsn = WaitForWalSummarization(backup_state->startpoint,
|
||||||
10000, &pending_lsn);
|
timeout_in_ms, &pending_lsn);
|
||||||
|
|
||||||
/* If WAL summarization has progressed sufficiently, stop waiting. */
|
/* If WAL summarization has progressed sufficiently, stop waiting. */
|
||||||
if (summarized_lsn >= backup_state->startpoint)
|
if (summarized_lsn >= backup_state->startpoint)
|
||||||
|
Reference in New Issue
Block a user