pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
openLogOff is not needed anymore
3+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2019-03-06 93473c6ac8  Removed unused variable, openLogOff.
* openLogOff is not needed anymore
@ 2019-03-06 11:12 Antonin Houska <ah@cybertec.at>
  2019-03-06 14:47 ` Re: openLogOff is not needed anymore Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Antonin Houska @ 2019-03-06 11:12 UTC (permalink / raw)
  To: pgsql-hackers

... 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.c index 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 ^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: openLogOff is not needed anymore
  2019-03-06 11:12 openLogOff is not needed anymore Antonin Houska <ah@cybertec.at>
@ 2019-03-06 14:47 ` Robert Haas <robertmhaas@gmail.com>
  2019-03-06 15:13   ` Re: openLogOff is not needed anymore Antonin Houska <ah@cybertec.at>
  0 siblings, 1 reply; 3+ messages in thread

From: Robert Haas @ 2019-03-06 14:47 UTC (permalink / raw)
  To: Antonin Houska <ah@cybertec.at>; +Cc: pgsql-hackers

On Wed, Mar 6, 2019 at 6:10 AM Antonin Houska <ah@cybertec.at> wrote:
> ... obviously due to commit c24dcd0. The following patch removes it.

Committed, after a short struggle to get the patch out of the email
body in a usable form.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: openLogOff is not needed anymore
  2019-03-06 11:12 openLogOff is not needed anymore Antonin Houska <ah@cybertec.at>
  2019-03-06 14:47 ` Re: openLogOff is not needed anymore Robert Haas <robertmhaas@gmail.com>
@ 2019-03-06 15:13   ` Antonin Houska <ah@cybertec.at>
  0 siblings, 0 replies; 3+ messages in thread

From: Antonin Houska @ 2019-03-06 15:13 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: pgsql-hackers

Robert Haas <robertmhaas@gmail.com> wrote:

> On Wed, Mar 6, 2019 at 6:10 AM Antonin Houska <ah@cybertec.at> wrote:
> > ... obviously due to commit c24dcd0. The following patch removes it.
> 
> Committed, after a short struggle to get the patch out of the email
> body in a usable form.

It was just convenient for me to use vc-diff emacs command and copy & paste
the diff into the message because I also use emacs as email client. I thought
it should work but perhaps something went wrong with spaces.

I'll always attach diffs to the message next time. Sorry for the problem.

-- 
Antonin Houska
https://www.cybertec-postgresql.com




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-03-06 15:13 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 11:12 openLogOff is not needed anymore Antonin Houska <ah@cybertec.at>
2019-03-06 14:47 ` Robert Haas <robertmhaas@gmail.com>
2019-03-06 15:13   ` Antonin Houska <ah@cybertec.at>

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