pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Antonin Houska <ah@cybertec.at>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Attempt to consolidate reading of XLOG page
Date: Fri, 15 Nov 2019 18:41:02 -0300
Message-ID: <20191115214102.GA15616@alvherre.pgsql> (raw)
In-Reply-To: <44237.1573556793@antos>

On 2019-Nov-12, Antonin Houska wrote:

> ok, the next version uses explicit lseek(). Maybe the fact that XLOG is mostly
> read sequentially (i.e. without frequent seeks) is the reason pread() has't
> been adopted so far.

I don't quite understand why you backed off from switching to pread.  It
seemed a good change to me.

Here's a few edits on top of your latest.

The new routine WALRead() is not at all the same as the previous
XLogRead, so I don't see why we would keep the name.  Hence renamed.

I see no reason for the openSegment callback to return the FD in an out
param instead of straight return value.  Changed that way.

Having seek/open be a boolean "xlr_seek" seems a bit weird.  Changed to
an "operation" enum.  (Maybe if we go back to pg_pread we can get rid of
this.)  Accordingly, change WALReadRaiseError and WALDumpReadPage.

Change xlr_seg to be a struct rather than pointer to struct.  It seems a
bit dangerous to me to return a pointer that we don't know is going to
be valid at raise-error time.  Struct assignment works fine for the
purpose.

Renamed XLogDumpReadPage to WALDumpReadPage, because what the heck is
XLogDump anyway?  That doesn't exist.

I would only like to switch this back to pg_pread() (from seek/read) and
I'd be happy to commit this.

What is logical_read_local_xlog_page all about?  Seems useless.  Let's
get rid of it.

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





view thread (62+ messages)  latest in thread

Message-ID: <20191115214102.GA15616@alvherre.pgsql>
Permalink:  ../20191115214102.GA15616@alvherre.pgsql/
Also on:    postgresql.org/message-id/20191115214102.GA15616@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, ah@cybertec.at, michael@paquier.xyz, thomas.munro@gmail.com, robertmhaas@gmail.com
  Subject: Re: Attempt to consolidate reading of XLOG page
  In-Reply-To: <20191115214102.GA15616@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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