pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Antonin Houska <ah@cybertec.at>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Attempt to consolidate reading of XLOG page
Date: Fri, 27 Sep 2019 15:28:38 -0400
Message-ID: <20329.1569612518@sss.pgh.pa.us> (raw)
In-Reply-To: <20190927191736.GA13447@alvherre.pgsql>
References: <20190927191736.GA13447@alvherre.pgsql>

Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2019-Sep-27, Antonin Houska wrote:
>>> You placed the errinfo in XLogRead's stack rather than its callers' ...
>>> I don't think that works, because as soon as XLogRead returns that
>>> memory is no longer guaranteed to exist.

>> I was aware of this problem, therefore I defined the field as static:
>> 
>> +XLogReadError *
>> +XLogRead(char *buf, XLogRecPtr startptr, Size count, TimeLineID *tli_p,
>> +                WALOpenSegment *seg, WALSegmentContext *segcxt,
>> +                WALSegmentOpen openSegment)
>> +{
>> +       char       *p;
>> +       XLogRecPtr      recptr;
>> +       Size            nbytes;
>> +       static XLogReadError errinfo;

> I see.

That seems like an absolutely terrible "fix".  We don't really want
XLogRead to be defined in a way that forces it to be non-reentrant do we?

			regards, tom lane





view thread (62+ messages)  latest in thread

Message-ID: <20329.1569612518@sss.pgh.pa.us>
Permalink:  ../20329.1569612518@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20329.1569612518@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, ah@cybertec.at, thomas.munro@gmail.com, robertmhaas@gmail.com
  Subject: Re: Attempt to consolidate reading of XLOG page
  In-Reply-To: <20329.1569612518@sss.pgh.pa.us>

* 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