Re: Attempt to consolidate reading of XLOG page

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Attempt to consolidate reading of XLOG page
Дата
Msg-id 20329.1569612518@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Attempt to consolidate reading of XLOG page  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Attempt to consolidate reading of XLOG page  (Antonin Houska <ah@cybertec.at>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: legrand legrand
Дата:
Сообщение: Re: Hooks for session start and end, take two
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: recovery starting when backup_label exists, but notrecovery.signal