Skip to content

Commit 3ae1fc2

Browse files
committed
bigfix: WAL retention didn`t protected WAL segments entitled to protection
1 parent c1b4110 commit 3ae1fc2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/catalog.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ pgBackupCreateDir(pgBackup *backup)
688688
parray *
689689
catalog_get_timelines(InstanceConfig *instance)
690690
{
691-
int i,j;
691+
int i,j,k;
692692
parray *xlog_files_list = parray_new();
693693
parray *timelineinfos;
694694
parray *backups;
@@ -1210,9 +1210,9 @@ catalog_get_timelines(InstanceConfig *instance)
12101210

12111211
GetXLogSegNo(tlinfo->anchor_lsn, anchor_segno, instance->xlog_seg_size);
12121212

1213-
for (i = 0; i < parray_num(tlinfo->xlog_filelist); i++)
1213+
for (j = 0; j < parray_num(tlinfo->xlog_filelist); j++)
12141214
{
1215-
xlogFile *wal_file = (xlogFile *) parray_get(tlinfo->xlog_filelist, i);
1215+
xlogFile *wal_file = (xlogFile *) parray_get(tlinfo->xlog_filelist, j);
12161216

12171217
if (wal_file->segno >= anchor_segno)
12181218
{
@@ -1225,9 +1225,9 @@ catalog_get_timelines(InstanceConfig *instance)
12251225
continue;
12261226

12271227
/* Protect segments belonging to one of the keep invervals */
1228-
for (j = 0; j < parray_num(tlinfo->keep_segments); j++)
1228+
for (k = 0; k < parray_num(tlinfo->keep_segments); k++)
12291229
{
1230-
xlogInterval *keep_segments = (xlogInterval *) parray_get(tlinfo->keep_segments, j);
1230+
xlogInterval *keep_segments = (xlogInterval *) parray_get(tlinfo->keep_segments, k);
12311231

12321232
if ((wal_file->segno >= keep_segments->begin_segno) &&
12331233
wal_file->segno <= keep_segments->end_segno)

0 commit comments

Comments
 (0)