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

Commit 0a87d49

Browse files
committed
minor fix to do_retention_purge
1 parent a53c4c1 commit 0a87d49

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/delete.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ do_retention_purge(void)
207207
}
208208

209209
/*
210-
* If oldest_lsn wasn`t set in prevous step
211-
* get oldest backup LSN and TLI for WAL purging
210+
* If oldest_lsn and oldest_tli weren`t set because previous step was skipped
211+
* then set them now if we are going to purge WAL
212212
*/
213213
if (delete_wal && (XLogRecPtrIsInvalid(oldest_lsn)))
214214
{
@@ -217,6 +217,11 @@ do_retention_purge(void)
217217
oldest_tli = backup->tli;
218218
}
219219

220+
/* Be paranoid */
221+
if (XLogRecPtrIsInvalid(oldest_lsn))
222+
elog(ERROR, "Not going to purge WAL because backup %s has invalid LSN",
223+
base36enc(backup->start_time));
224+
220225
/* Purge WAL files */
221226
if (delete_wal)
222227
{

0 commit comments

Comments
 (0)