Re: Remove page-read callback from XLogReaderState.

From: Antonin Houska <ah(at)cybertec(dot)at>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove page-read callback from XLogReaderState.
Date: 2019-05-22 11:53:23
Message-ID: 25494.1558526003@spoje.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:

> Hello. Thank you for looking this.
> ...
> Yeah, I'll register this, maybe the week after next week.

I've checked the new version. One more thing I noticed now is that XLR_STATE.j
is initialized to zero, either by XLogReaderAllocate() which zeroes the whole
reader state, or later by XLREAD_RESET. This special value then needs to be
handled here:

#define XLR_SWITCH() \
do { \
if ((XLR_STATE).j) \
goto *((void *) (XLR_STATE).j); \
XLR_CASE(XLR_INIT_STATE); \
} while (0)

I think it's better to set the label always to (&&XLR_INIT_STATE) so that
XLR_SWITCH can perform the jump unconditionally.

Attached is also an (unrelated) comment fix proposal.

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

Attachment Content-Type Size
xlr_comment_fix.patch text/x-diff 569 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-05-22 12:17:40 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Tomas Vondra 2019-05-22 11:19:23 Re: accounting for memory used for BufFile during hash joins