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

Commit 2f08a4b

Browse files
committed
Merge remote-tracking branch 'origin/pgpro-1303'
2 parents 073066b + 2a87b31 commit 2f08a4b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/delete.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ delete_walfiles(XLogRecPtr oldest_lsn, TimeLineID oldest_tli)
321321
while (errno = 0, (arcde = readdir(arcdir)) != NULL)
322322
{
323323
/*
324-
* We ignore the timeline part of the XLOG segment identifiers in
324+
* We ignore the timeline part of the WAL segment identifiers in
325325
* deciding whether a segment is still needed. This ensures that
326326
* we won't prematurely remove a segment from a parent timeline.
327327
* We could probably be a little more proactive about removing
@@ -332,10 +332,13 @@ delete_walfiles(XLogRecPtr oldest_lsn, TimeLineID oldest_tli)
332332
* decide which ones are earlier than the exclusiveCleanupFileName
333333
* file. Note that this means files are not removed in the order
334334
* they were originally written, in case this worries you.
335+
*
336+
* We also should not forget that WAL segment can be compressed.
335337
*/
336338
if (IsXLogFileName(arcde->d_name) ||
337339
IsPartialXLogFileName(arcde->d_name) ||
338-
IsBackupHistoryFileName(arcde->d_name))
340+
IsBackupHistoryFileName(arcde->d_name) ||
341+
IsCompressedXLogFileName(arcde->d_name))
339342
{
340343
if (XLogRecPtrIsInvalid(oldest_lsn) ||
341344
strncmp(arcde->d_name + 8, oldestSegmentNeeded + 8, 16) < 0)

src/pg_probackup.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ typedef struct
267267
#define XLogDataFromLSN(data, xlogid, xrecoff) \
268268
sscanf(data, "%X/%X", xlogid, xrecoff)
269269

270+
#define IsCompressedXLogFileName(fname) \
271+
(strlen(fname) == XLOG_FNAME_LEN + strlen(".gz") && \
272+
strspn(fname, "0123456789ABCDEF") == XLOG_FNAME_LEN && \
273+
strcmp((fname) + XLOG_FNAME_LEN, ".gz") == 0)
274+
270275
/* directory options */
271276
extern char *backup_path;
272277
extern char backup_instance_path[MAXPGPATH];

0 commit comments

Comments
 (0)