WAL reader APIs and WAL segment open/close callbacks

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Antonin Houska <ah(at)cybertec(dot)at>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: WAL reader APIs and WAL segment open/close callbacks
Date: 2020-05-24 22:44:09
Message-ID: 20200524224409.GA387341@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I have been playing with the new APIs of xlogreader.h, and while
merging some of my stuff with 13, I found the handling around
->seg.ws_file overcomplicated and confusing as it is necessary for a
plugin to manipulate directly the fd of an opened segment in the WAL
segment open/close callbacks.

Wouldn't it be cleaner to limit the exposition of ->seg.ws_file to the
user if possible? There are cases like a WAL sender where you cannot
do that, but something that came to my mind is to make
WALSegmentOpenCB return the fd of the opened segment, and pass down the
fd to close to WALSegmentCloseCB. Then xlogreader.c is in charge of
resetting the field when a segment is closed.

Any thoughts?
--
Michael

Attachment Content-Type Size
xlogreader-fds-v1.patch text/x-diff 8.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2020-05-24 22:52:48 Re: Failure to create GiST on ltree column
Previous Message Dagfinn Ilmari Mannsåker 2020-05-24 21:05:30 Missing links between system catalog documentation pages