Re: 2pc leaks fds
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Antonin Houska <ah@cybertec.at>
Cc: Andres Freund <andres@anarazel.de>, Michael Paquier <michael@paquier.xyz>, pgsql-hackers@postgresql.org
Date: 2020-04-21T23:54:22Z
Lists: pgsql-hackers
On 2020-Apr-08, Antonin Houska wrote: > Specifically for 2PC, isn't it better to close some OS-level FD of an > unrelated table scan and then succeed than to ERROR immediately? Anyway, > 0dc8ead46 hasn't changed this. I think for full generality of the interface, we pass a "close" callback in addition to the "open" callback. But if we were to pass it only for WALRead, then there would be no way to call it during XLogReaderFree. I think the fix Andres applied is okay as far as it goes, but for the long term we may want to change the interface even further -- maybe by having these functions be part of the XLogReader state struct. I have this code paged out of my head ATM, but maybe tomorrow I can give it a little think. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix obsolete references to "XLogRead"
- a8be5364ac16 13.0 landed
-
Rework XLogReader callback system
- b060dbe0001a 13.0 landed
-
Fix XLogReader FD leak that makes backends unusable after 2PC usage.
- 91c40548d5f7 13.0 landed
-
Refactor WAL file-reading code into WALRead()
- 0dc8ead46363 13.0 cited
-
Add ArchiveOpts to pass options to ArchiveEntry
- f831d4accda0 12.0 cited