We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent5787c67 commit5940413Copy full SHA for 5940413
src/backend/access/transam/xlog.c
@@ -7523,9 +7523,9 @@ CreateRestartPoint(int flags)
7523
}
7524
7525
/*
7526
- *Calculate the last segment that we need to retain because of
7527
- * wal_keep_segments,by subtracting wal_keep_segments from
7528
- * the given xlog location, recptr.
+ *Retreat *logSegNo to the last segment that we need to retain because of
+ * wal_keep_segments. This is calculatedby subtracting wal_keep_segments
+ *fromthe given xlog location, recptr.
7529
*/
7530
staticvoid
7531
KeepLogSeg(XLogRecPtrrecptr,XLogSegNo*logSegNo)
@@ -7541,7 +7541,7 @@ KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo)
7541
if (segno <=wal_keep_segments)
7542
segno=1;
7543
else
7544
-segno=*logSegNo-wal_keep_segments;
+segno=segno-wal_keep_segments;
7545
7546
/* don't delete WAL segments newer than the calculated segment */
7547
if (segno<*logSegNo)