postgresql/src/backend
Amit Kapila d207038053 Fix running out of file descriptors for spill files.
Currently while decoding changes, if the number of changes exceeds a
certain threshold, we spill those to disk.  And this happens for each
(sub)transaction.  Now, while reading all these files, we don't close them
until we read all the files.  While reading these files, if the number of
such files exceeds the maximum number of file descriptors, the operation
errors out.

Use PathNameOpenFile interface to open these files as that internally has
the mechanism to release kernel FDs as needed to get us under the
max_safe_fds limit.

Reported-by: Amit Khandekar
Author: Amit Khandekar
Reviewed-by: Amit Kapila
Backpatch-through: 9.4
Discussion: https://postgr.es/m/CAJ3gD9c-sECEn79zXw4yBnBdOttacoE-6gAyP0oy60nfs_sabQ@mail.gmail.com
2020-01-02 11:41:04 +05:30
..
access Revise BTP_HAS_GARBAGE nbtree VACUUM comments. 2020-01-01 17:29:41 -08:00
bootstrap Update copyrights for 2020 2020-01-01 12:21:45 -05:00
catalog Update copyrights for 2020 2020-01-01 12:21:45 -05:00
commands Update copyrights for 2020 2020-01-01 12:21:45 -05:00
executor Update copyrights for 2020 2020-01-01 12:21:45 -05:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit Update copyrights for 2020 2020-01-01 12:21:45 -05:00
lib Update copyrights for 2020 2020-01-01 12:21:45 -05:00
libpq Update copyrights for 2020 2020-01-01 12:21:45 -05:00
main Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nodes Update copyrights for 2020 2020-01-01 12:21:45 -05:00
optimizer Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parser Update copyrights for 2020 2020-01-01 12:21:45 -05:00
partitioning Update copyrights for 2020 2020-01-01 12:21:45 -05:00
po Translation updates 2019-06-17 15:30:20 +02:00
port Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postmaster Update copyrights for 2020 2020-01-01 12:21:45 -05:00
regex Update copyrights for 2020 2020-01-01 12:21:45 -05:00
replication Fix running out of file descriptors for spill files. 2020-01-02 11:41:04 +05:30
rewrite Update copyrights for 2020 2020-01-01 12:21:45 -05:00
snowball Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statistics Update copyrights for 2020 2020-01-01 12:21:45 -05:00
storage Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tcop Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tsearch Update copyrights for 2020 2020-01-01 12:21:45 -05:00
utils Update copyrights for 2020 2020-01-01 12:21:45 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2019-05-20 16:00:53 +02:00