pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Rework XLogReader callback system
2+ messages / 2 participants
[nested] [flat]

* pgsql: Rework XLogReader callback system
@ 2020-05-08 19:53 Alvaro Herrera <alvherre@alvh.no-ip.org>
  2020-05-09 01:54 ` Re: pgsql: Rework XLogReader callback system Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Alvaro Herrera @ 2020-05-08 19:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Rework XLogReader callback system

Code review for 0dc8ead46363, prompted by a bug closed by 91c40548d5f7.

XLogReader's system for opening and closing segments had gotten too
complicated, with callbacks being passed at both the XLogReaderAllocate
level (read_page) as well as at the WALRead level (segment_open).  This
was confusing and hard to follow, so restructure things so that these
callbacks are passed together at XLogReaderAllocate time, and add
another callback to the set (segment_close) to make it a coherent whole.
Also, ensure XLogReaderState is an argument to all the callbacks, so
that they can grab at the ->private data if necessary.

Document the whole arrangement more clearly.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/20200422175754.GA19858@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b060dbe0001a1d6bf26cd294710f3cb203868d46

Modified Files
--------------
src/backend/access/transam/twophase.c          |   5 +-
src/backend/access/transam/xlog.c              |  10 ++-
src/backend/access/transam/xlogreader.c        |  51 ++++++-----
src/backend/access/transam/xlogutils.c         |  24 +++--
src/backend/replication/logical/logical.c      |  20 +++--
src/backend/replication/logical/logicalfuncs.c |   4 +-
src/backend/replication/slotfuncs.c            |  10 ++-
src/backend/replication/walsender.c            |  36 +++++---
src/bin/pg_rewind/parsexlog.c                  |   9 +-
src/bin/pg_waldump/pg_waldump.c                |  30 +++++--
src/include/access/xlogreader.h                | 119 ++++++++++++++++---------
src/include/access/xlogutils.h                 |   5 ++
src/include/replication/logical.h              |   4 +-
13 files changed, 214 insertions(+), 113 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pgsql: Rework XLogReader callback system
  2020-05-08 19:53 pgsql: Rework XLogReader callback system Alvaro Herrera <alvherre@alvh.no-ip.org>
@ 2020-05-09 01:54 ` Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2020-05-09 01:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org; +Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>

Hello,

On 2020-May-08, Alvaro Herrera wrote:

> Rework XLogReader callback system

I think this commit is causing buildfarm members bowerbird to crash, but
it's not getting any backtrace.  Is it perchance possible to enable
whatever buildfarm feature it is that reports backtraces from crashes?
That would be very helpful.

(Andrew CCed because bowerbird is his animal.)

Thanks,

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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-05-09 01:54 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 19:53 pgsql: Rework XLogReader callback system Alvaro Herrera <alvherre@alvh.no-ip.org>
2020-05-09 01:54 ` Alvaro Herrera <alvherre@2ndquadrant.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox