Close the file descriptor in ApplyLogicalMappingFile

Tomas Vondra <tomas.vondra@postgresql.org>

Commit: ef1ac5b2ad08cf002d8cb7af9719513a0190fd54
Author: Tomas Vondra <tomas.vondra@postgresql.org>
Date: 2018-08-16T14:51:00Z
Releases: 9.4.20
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

Files

PathChange+/−
src/backend/replication/logical/reorderbuffer.c modified +3 −1

Discussion