pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix running out of file descriptors for spill files.
Date: Thu, 02 Jan 2020 07:25:41 +0000
Message-ID: <E1imurV-0000KX-CO@gemulon.postgresql.org> (raw)

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3e3a7973523570089fa69533dcb3aa0122636d8c

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 47 +++++++++++++++----------
src/test/recovery/t/006_logical_decoding.pl     | 39 +++++++++++++++++++-
2 files changed, 66 insertions(+), 20 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1imurV-0000KX-CO@gemulon.postgresql.org>
Permalink:  ../E1imurV-0000KX-CO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1imurV-0000KX-CO@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org
  Subject: Re: pgsql: Fix running out of file descriptors for spill files.
  In-Reply-To: <E1imurV-0000KX-CO@gemulon.postgresql.org>
  References: <E1imurV-0000KX-CO@gemulon.postgresql.org>

* 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