@@ -771,13 +771,11 @@ static const char *xlogSourceNames[] = {"any", "archive", "pg_wal", "stream"};
771771
772772/*
773773 * openLogFile is -1 or a kernel FD for an open log file segment.
774- * When it's open, openLogOff is the current seek offset in the file.
775- * openLogSegNo identifies the segment. These variables are only
776- * used to write the XLOG, and so will normally refer to the active segment.
774+ * openLogSegNo identifies the segment. These variables are only used to
775+ * write the XLOG, and so will normally refer to the active segment.
777776 */
778777static int openLogFile = -1 ;
779778static XLogSegNo openLogSegNo = 0 ;
780- static uint32 openLogOff = 0 ;
781779
782780/*
783781 * These variables are used similarly to the ones above, but for reading
@@ -2447,7 +2445,6 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible)
24472445/* create/use new log file */
24482446use_existent = true;
24492447openLogFile = XLogFileInit (openLogSegNo ,& use_existent , true);
2450- openLogOff = 0 ;
24512448}
24522449
24532450/* Make sure we have the current logfile open */
@@ -2456,7 +2453,6 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible)
24562453XLByteToPrevSeg (LogwrtResult .Write ,openLogSegNo ,
24572454wal_segment_size );
24582455openLogFile = XLogFileOpen (openLogSegNo );
2459- openLogOff = 0 ;
24602456}
24612457
24622458/* Add current page to the set of pending pages-to-dump */
@@ -2508,15 +2504,13 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible)
25082504errmsg ("could not write to log file %s "
25092505"at offset %u, length %zu: %m" ,
25102506XLogFileNameP (ThisTimeLineID ,openLogSegNo ),
2511- openLogOff ,nbytes )));
2507+ startoffset ,nbytes )));
25122508}
25132509nleft -= written ;
25142510from += written ;
25152511startoffset += written ;
25162512}while (nleft > 0 );
25172513
2518- /* Update state for write */
2519- openLogOff += nbytes ;
25202514npages = 0 ;
25212515
25222516/*
@@ -2602,7 +2596,6 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible)
26022596XLByteToPrevSeg (LogwrtResult .Write ,openLogSegNo ,
26032597wal_segment_size );
26042598openLogFile = XLogFileOpen (openLogSegNo );
2605- openLogOff = 0 ;
26062599}
26072600
26082601issue_xlog_fsync (openLogFile ,openLogSegNo );