Re: Attempt to consolidate reading of XLOG page

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Attempt to consolidate reading of XLOG page
Date: 2019-11-22 22:56:32
Message-ID: 20191122225632.GA9169@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Nov-22, Antonin Houska wrote:

> As I pointed out in
>
> https://www.postgresql.org/message-id/88183.1574261429%40antos
>
> seg.ws_off only replaced readOff in XLogReaderState. So we should only update
> ws_off where readOff was updated before commit 709d003. This does happen in
> ReadPageInternal (see HEAD) and I see no reason for the final patch to update
> ws_off anywhere else.

Oh you're right.

I see no reason to leave ws_off. We can move that to XLogReaderState; I
did that here. We also need the offset in WALReadError, though, so I
added it there too. Conceptually it seems clearer to me this way.

What do you think of the attached?

BTW I'm not clear what errors can pread()/pg_pread() report that do not
set errno. I think lines 1083/1084 of WALRead are spurious now.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v12-0001-Use-only-xlogreader.c-WALRead.patch text/x-diff 33.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2019-11-22 22:57:13 RE: [BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?
Previous Message Tomas Vondra 2019-11-22 22:54:15 Re: [BUG] (firsttupleslot)==NULL is redundant or is possible null dereference?