Re: 2pc leaks fds

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: Antonin Houska <ah@cybertec.at>, pgsql-hackers@postgresql.org, Alvaro Herrera <alvherre@2ndquadrant.com>
Date: 2020-04-08T06:29:59Z
Lists: pgsql-hackers
On Tue, Apr 07, 2020 at 05:12:49PM -0700, Andres Freund wrote:
> I pushed a fix. While it might not be the best medium/long term fix, it
> unbreaks 2PC.  Perhaps we should add an open item to track whether we
> want to fix this differently?

Sounds fine to me.  I have updated the open item that we have now by
adding a comment that the leak has been fixed by 91c4054, but that
we should revisit the refactoring.
--
Michael

Commits

  1. Fix obsolete references to "XLogRead"

  2. Rework XLogReader callback system

  3. Fix XLogReader FD leak that makes backends unusable after 2PC usage.

  4. Refactor WAL file-reading code into WALRead()

  5. Add ArchiveOpts to pass options to ArchiveEntry