pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antonin Houska <ah@cybertec.at>
To: Andres Freund <andres@anarazel.de>
To: Michael Paquier <michael@paquier.xyz>
To: pgsql-hackers@postgresql.org, Alvaro Herrera <alvherre@2ndquadrant.com>
Subject: Re: 2pc leaks fds
Date: Wed, 08 Apr 2020 09:26:37 +0200
Message-ID: <70058.1586330797@antos> (raw)
In-Reply-To: <26247.1586157152@antos>
References: <20200406025651.fpzdb5yyb7qyhqko@alap3.anarazel.de>
	<20200406052648.GB2066@paquier.xyz>
	<20200406054449.ssmrzj4fav3ewvaq@alap3.anarazel.de>
	<26247.1586157152@antos>

Antonin Houska <ah@cybertec.at> wrote:

> Andres Freund <andres@anarazel.de> wrote:
> > But I'm not sure it's quite the right idea. I'm not sure I fully
> > understand the design of 0dc8ead46, but it looks to me like it's
> > intended to allow users of the interface to have different ways of
> > opening files. If we just close() the fd that'd be a bit more limited.
> 
> It should have allowed users to have different ways to *locate the segment*
> file. The WALSegmentOpen callback could actually return file path instead of
> the file descriptor and let WALRead() perform the opening/closing, but then
> the WALRead function would need to be aware whether it is executing in backend
> or in frontend (so it can use the correct function to open/close the file).

Well, #ifdef FRONTEND can be used to distinguish the caller of
WALRead(). However now that I tried to adjust the API, I see that
pg_waldump.c:WALDumpOpenSegment uses specific logic to open the file. So if
the callback only returned the file name, there would be no suitable place for
the things that WALDumpOpenSegment does.

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





view thread (23+ messages)  latest in thread

Message-ID: <70058.1586330797@antos>
Permalink:  ../70058.1586330797@antos/
Also on:    postgresql.org/message-id/70058.1586330797@antos

 · 

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: ah@cybertec.at, andres@anarazel.de, michael@paquier.xyz, alvherre@2ndquadrant.com
  Subject: Re: 2pc leaks fds
  In-Reply-To: <70058.1586330797@antos>

* 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