From: Antonin Houska <ah@cybertec.at>
To: pgsql-hackers@postgresql.org
Subject: openLogOff is not needed anymore
Date: Wed, 06 Mar 2019 12:12:10 +0100
Message-ID: <30413.1551870730@localhost> (raw)
... obviously due to commit c24dcd0. The following patch removes it.
inline patch 1: src/backend/access/transam/xlog.c (+3/-10 lines) download inline-1.patchdiff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.cindex ecd12fc53a..0fdd82a287 100644--- a/src/backend/access/transam/xlog.c+++ b/src/backend/access/transam/xlog.c@@ -771,13 +771,11 @@ static const char *xlogSourceNames[] = {"any", "archive", "pg_wal", "stream"};
/*
* openLogFile is -1 or a kernel FD for an open log file segment.
- * When it's open, openLogOff is the current seek offset in the file.- * openLogSegNo identifies the segment. These variables are only- * used to write the XLOG, and so will normally refer to the active segment.+ * openLogSegNo identifies the segment. These variables are only used to+ * write the XLOG, and so will normally refer to the active segment.
*/
static int openLogFile = -1;
static XLogSegNo openLogSegNo = 0;
-static uint32 openLogOff = 0;
/*
* These variables are used similarly to the ones above, but for reading
@@ -2447,7 +2445,6 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible)
/* create/use new log file */
use_existent = true;
openLogFile = XLogFileInit(openLogSegNo, &use_existent, true);
- openLogOff = 0;
}
/* Make sure we have the current logfile open */
@@ -2456,7 +2453,6 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible)
XLByteToPrevSeg(LogwrtResult.Write, openLogSegNo,
wal_segment_size);
openLogFile = XLogFileOpen(openLogSegNo);
- openLogOff = 0;
}
/* Add current page to the set of pending pages-to-dump */
@@ -2508,15 +2504,13 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible)
errmsg("could not write to log file %s "
"at offset %u, length %zu: %m",
XLogFileNameP(ThisTimeLineID, openLogSegNo),
- openLogOff, nbytes)));+ startoffset, nbytes)));
}
nleft -= written;
from += written;
startoffset += written;
} while (nleft > 0);
- /* Update state for write */- openLogOff += nbytes;
npages = 0;
/*
@@ -2602,7 +2596,6 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible)
XLByteToPrevSeg(LogwrtResult.Write, openLogSegNo,
wal_segment_size);
openLogFile = XLogFileOpen(openLogSegNo);
- openLogOff = 0;
}
issue_xlog_fsync(openLogFile, openLogSegNo);
--
Antonin Houska
https://www.cybertec-postgresql.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: ah@cybertec.at
Subject: Re: openLogOff is not needed anymore
In-Reply-To: <30413.1551870730@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox