Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5940413

Browse files
committed
Fix calculation of how many segments to retain for wal_keep_segments.
KeepLogSeg function was broken when we switched to use a 64-bit int for thesegment number.Per report from Jeff Janes.
1 parent5787c67 commit5940413

File tree

1 file changed

+4
-4
lines changed
  • src/backend/access/transam

1 file changed

+4
-4
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7523,9 +7523,9 @@ CreateRestartPoint(int flags)
75237523
}
75247524

75257525
/*
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.
7526+
*Retreat *logSegNo to the last segment that we need to retain because of
7527+
* wal_keep_segments. This is calculatedby subtracting wal_keep_segments
7528+
*fromthe given xlog location, recptr.
75297529
*/
75307530
staticvoid
75317531
KeepLogSeg(XLogRecPtrrecptr,XLogSegNo*logSegNo)
@@ -7541,7 +7541,7 @@ KeepLogSeg(XLogRecPtr recptr, XLogSegNo *logSegNo)
75417541
if (segno <=wal_keep_segments)
75427542
segno=1;
75437543
else
7544-
segno=*logSegNo-wal_keep_segments;
7544+
segno=segno-wal_keep_segments;
75457545

75467546
/* don't delete WAL segments newer than the calculated segment */
75477547
if (segno<*logSegNo)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp