Re: Attempt to consolidate reading of XLOG page

From: Antonin Houska <ah(at)cybertec(dot)at>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Attempt to consolidate reading of XLOG page
Date: 2019-05-02 16:17:36
Message-ID: 9308.1556813856@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Antonin Houska <ah(at)cybertec(dot)at> wrote:

> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>
> > Not sure about the walsize; maybe it can be a member in XLogReadPos, and
> > given to XLogReadInitPos()? (Maybe rename XLogReadPos as
> > XLogReadContext or something like that, indicating it's not just the
> > read position.)
>
> As pointed out by others, XLogReadPos is not necessary. So if XLogRead()
> receives XLogReaderState instead, it can get the segment size from there.

Eventually I found out that it's good to have a separate structure for the
read position because walsender calls the XLogRead() function directly, not
via the XLOG reader. Currently the structure name is XLogSegment (maybe
someone can propose better name) and it's a member of XLogReaderState. No
field of the new structure is duplicated now.

The next version of the patch is attached.

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

Attachment Content-Type Size
v02_001_Unexport_XLogReaderInvalReadState.patch text/x-diff 1.7 KB
v02_002_Remove_TLI_argument_from_XLR_callback.patch text/x-diff 9.8 KB
v02_003_Introduce_XLogSegment.patch text/x-diff 17.9 KB
v02_004_Use_only_one_implementation_of_XLogRead.patch text/x-diff 14.6 KB
v02_005_Cleanup.patch text/x-diff 13.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2019-05-02 16:24:17 Re: pg_upgrade --clone error checking
Previous Message Alvaro Herrera 2019-05-02 16:03:35 Re: New vacuum option to do only freezing