diff options
author | Robert Haas <rhaas@postgresql.org> | 2024-01-03 09:59:46 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2024-01-03 09:59:46 -0500 |
commit | dffde5bf16a590543a35bedffc936a33686651d4 (patch) | |
tree | fe5b3db093a3fd261f7d2150e007e277224a065f /src/backend/backup/basebackup_incremental.c | |
parent | 8ce5aef2e6337a5c1f6693c486c28310c2b35dfc (diff) | |
download | postgresql-dffde5bf16a590543a35bedffc936a33686651d4.tar.gz postgresql-dffde5bf16a590543a35bedffc936a33686651d4.zip |
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
Diffstat (limited to 'src/backend/backup/basebackup_incremental.c')
-rw-r--r-- | src/backend/backup/basebackup_incremental.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/backup/basebackup_incremental.c b/src/backend/backup/basebackup_incremental.c index 22b861ce528..3ab2bfd68d9 100644 --- a/src/backend/backup/basebackup_incremental.c +++ b/src/backend/backup/basebackup_incremental.c @@ -436,12 +436,12 @@ PrepareForIncrementalBackup(IncrementalBackupInfo *ib, * drifting to something that is not a multiple of ten. */ timeout_in_ms -= - TimestampDifferenceMilliseconds(current_time, initial_time) % + TimestampDifferenceMilliseconds(initial_time, current_time) % timeout_in_ms; /* Wait for up to 10 seconds. */ summarized_lsn = WaitForWalSummarization(backup_state->startpoint, - 10000, &pending_lsn); + timeout_in_ms, &pending_lsn); /* If WAL summarization has progressed sufficiently, stop waiting. */ if (summarized_lsn >= backup_state->startpoint) |