pgsql: Close the file descriptor in ApplyLogicalMappingFile

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Close the file descriptor in ApplyLogicalMappingFile
Date: 2018-08-16 14:55:57
Message-ID: E1fqJgr-0008U8-SW@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Close the file descriptor in ApplyLogicalMappingFile

The function was forgetting to close the file descriptor, resulting
in failures like this:

ERROR: 53000: exceeded maxAllocatedDescs (492) while trying to open
file "pg_logical/mappings/map-4000-4eb-1_60DE1E08-5376b5-537c6b"
LOCATION: OpenTransientFile, fd.c:2161

Simply close the file at the end, and backpatch to 9.4 (where logical
decoding was introduced). While at it, fix a nearby typo.

Discussion: https://www.postgresql.org/message-id/flat/738a590a-2ce5-9394-2bef-7b1caad89b37%402ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fa73b377ee11ced0c051fb42c29a87b5c71b79e3

Modified Files
--------------
src/backend/replication/logical/reorderbuffer.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2018-08-16 16:01:00 pgsql: Fix executor prune failure when plan already pruned
Previous Message Tomas Vondra 2018-08-16 14:55:41 pgsql: Close the file descriptor in ApplyLogicalMappingFile