postgresql/src/backend
Amit Kapila f8a6d8e71b 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:53:53 +05:30
..
access Remove shadow variables linked to RedoRecPtr in xlog.c 2019-12-18 10:11:31 +09:00
bootstrap In bootstrap mode, use default signal handling for SIGINT etc. 2019-05-14 10:22:28 -04:00
catalog Disallow partition key expressions that return pseudo-types. 2019-12-23 12:53:13 -05:00
commands Forbid DROP SCHEMA on temporary namespaces 2019-12-27 17:59:12 +09:00
executor Rotate instead of shifting hash join batch number. 2019-12-24 13:07:54 +13:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Don't rely on llvm::make_unique. 2019-08-25 14:46:29 +12:00
lib Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
libpq Avoid downcasing/truncation of RADIUS authentication parameters. 2019-11-13 13:41:04 -05:00
main Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
nodes Prevent overly-aggressive collapsing of joins to RTE_RESULT relations. 2019-12-14 13:49:15 -05:00
optimizer Prevent overly-aggressive collapsing of joins to RTE_RESULT relations. 2019-12-14 13:49:15 -05:00
parser Fix handling of GENERATED columns in CREATE TABLE LIKE INCLUDING DEFAULTS. 2019-09-25 17:30:42 -04:00
partitioning Remove extra parenthesis from comment. 2019-12-12 15:45:01 +09:00
po Translation updates 2019-11-11 10:53:15 +01:00
port Fix race condition in our Windows signal emulation. 2019-12-09 15:03:51 -05:00
postmaster Clean up properly error_context_stack in autovacuum worker on exception 2019-10-23 10:25:46 +09:00
regex Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
replication Fix running out of file descriptors for spill files. 2020-01-02 11:53:53 +05:30
rewrite Defend against self-referential views in relation_is_updatable(). 2019-11-21 16:21:43 -05:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Remove unnecessary clauses_attnums variable 2019-11-28 23:28:53 +01:00
storage Fix mdsyncfiletag(), take II. 2019-12-14 19:03:44 +13:00
tcop Stabilize NOTIFY behavior by transmitting notifies before ReadyForQuery. 2019-11-24 14:42:59 -05:00
tsearch Suppress warning from older compilers. 2019-11-03 16:10:38 -05:00
utils Fix EXTRACT(ISOYEAR FROM timestamp) for years BC. 2019-12-12 12:30:44 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
nls.mk Translation updates 2019-09-29 23:57:17 +02:00