@@ -891,8 +891,8 @@ static int emode_for_corrupt_record(int emode, XLogRecPtr RecPtr);
891891static void XLogFileClose (void );
892892static void PreallocXlogFiles (XLogRecPtr endptr );
893893static void RemoveTempXlogFiles (void );
894- static void RemoveOldXlogFiles (XLogSegNo segno , XLogRecPtr RedoRecPtr , XLogRecPtr endptr );
895- static void RemoveXlogFile (const char * segname , XLogRecPtr RedoRecPtr , XLogRecPtr endptr );
894+ static void RemoveOldXlogFiles (XLogSegNo segno , XLogRecPtr lastredoptr , XLogRecPtr endptr );
895+ static void RemoveXlogFile (const char * segname , XLogRecPtr lastredoptr , XLogRecPtr endptr );
896896static void UpdateLastRemovedPtr (char * filename );
897897static void ValidateXLOGDirectoryStructure (void );
898898static void CleanupBackupHistory (void );
@@ -2298,7 +2298,7 @@ assign_checkpoint_completion_target(double newval, void *extra)
22982298 * XLOG segments? Returns the highest segment that should be preallocated.
22992299 */
23002300static XLogSegNo
2301- XLOGfileslop (XLogRecPtr RedoRecPtr )
2301+ XLOGfileslop (XLogRecPtr lastredoptr )
23022302{
23032303 XLogSegNo minSegNo ;
23042304 XLogSegNo maxSegNo ;
@@ -2310,9 +2310,9 @@ XLOGfileslop(XLogRecPtr RedoRecPtr)
23102310 * correspond to. Always recycle enough segments to meet the minimum, and
23112311 * remove enough segments to stay below the maximum.
23122312 */
2313- minSegNo = RedoRecPtr / wal_segment_size +
2313+ minSegNo = lastredoptr / wal_segment_size +
23142314 ConvertToXSegs (min_wal_size_mb , wal_segment_size ) - 1 ;
2315- maxSegNo = RedoRecPtr / wal_segment_size +
2315+ maxSegNo = lastredoptr / wal_segment_size +
23162316 ConvertToXSegs (max_wal_size_mb , wal_segment_size ) - 1 ;
23172317
23182318 /*
@@ -2327,7 +2327,7 @@ XLOGfileslop(XLogRecPtr RedoRecPtr)
23272327 /* add 10% for good measure. */
23282328 distance *= 1.10 ;
23292329
2330- recycleSegNo = (XLogSegNo ) ceil (((double ) RedoRecPtr + distance ) /
2330+ recycleSegNo = (XLogSegNo ) ceil (((double ) lastredoptr + distance ) /
23312331 wal_segment_size );
23322332
23332333 if (recycleSegNo < minSegNo )
@@ -3948,12 +3948,12 @@ RemoveTempXlogFiles(void)
39483948/*
39493949 * Recycle or remove all log files older or equal to passed segno.
39503950 *
3951- * endptr is current (or recent) end of xlog, and RedoRecPtr is the
3951+ * endptr is current (or recent) end of xlog, and lastredoptr is the
39523952 * redo pointer of the last checkpoint. These are used to determine
39533953 * whether we want to recycle rather than delete no-longer-wanted log files.
39543954 */
39553955static void
3956- RemoveOldXlogFiles (XLogSegNo segno , XLogRecPtr RedoRecPtr , XLogRecPtr endptr )
3956+ RemoveOldXlogFiles (XLogSegNo segno , XLogRecPtr lastredoptr , XLogRecPtr endptr )
39573957{
39583958 DIR * xldir ;
39593959 struct dirent * xlde ;
@@ -3996,7 +3996,7 @@ RemoveOldXlogFiles(XLogSegNo segno, XLogRecPtr RedoRecPtr, XLogRecPtr endptr)
39963996 /* Update the last removed location in shared memory first */
39973997 UpdateLastRemovedPtr (xlde -> d_name );
39983998
3999- RemoveXlogFile (xlde -> d_name , RedoRecPtr , endptr );
3999+ RemoveXlogFile (xlde -> d_name , lastredoptr , endptr );
40004000 }
40014001 }
40024002 }
@@ -4070,14 +4070,14 @@ RemoveNonParentXlogFiles(XLogRecPtr switchpoint, TimeLineID newTLI)
40704070/*
40714071 * Recycle or remove a log file that's no longer needed.
40724072 *
4073- * endptr is current (or recent) end of xlog, and RedoRecPtr is the
4073+ * endptr is current (or recent) end of xlog, and lastredoptr is the
40744074 * redo pointer of the last checkpoint. These are used to determine
40754075 * whether we want to recycle rather than delete no-longer-wanted log files.
4076- * If RedoRecPtr is not known, pass invalid, and the function will recycle,
4076+ * If lastredoptr is not known, pass invalid, and the function will recycle,
40774077 * somewhat arbitrarily, 10 future segments.
40784078 */
40794079static void
4080- RemoveXlogFile (const char * segname , XLogRecPtr RedoRecPtr , XLogRecPtr endptr )
4080+ RemoveXlogFile (const char * segname , XLogRecPtr lastredoptr , XLogRecPtr endptr )
40814081{
40824082 char path [MAXPGPATH ];
40834083#ifdef WIN32
@@ -4093,10 +4093,10 @@ RemoveXlogFile(const char *segname, XLogRecPtr RedoRecPtr, XLogRecPtr endptr)
40934093 * Initialize info about where to try to recycle to.
40944094 */
40954095 XLByteToSeg (endptr , endlogSegNo , wal_segment_size );
4096- if (RedoRecPtr == InvalidXLogRecPtr )
4096+ if (lastredoptr == InvalidXLogRecPtr )
40974097 recycleSegNo = endlogSegNo + 10 ;
40984098 else
4099- recycleSegNo = XLOGfileslop (RedoRecPtr );
4099+ recycleSegNo = XLOGfileslop (lastredoptr );
41004100 }
41014101 else
41024102 recycleSegNo = 0 ; /* keep compiler quiet */
0 commit comments