Skip to content

Commit 43ba5ac

Browse files
committed
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
1 parent 36147ec commit 43ba5ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/replication/logical/reorderbuffer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3278,11 +3278,13 @@ ApplyLogicalMappingFile(HTAB *tuplecid_data, Oid relid, const char *fname)
32783278
new_ent->combocid = ent->combocid;
32793279
}
32803280
}
3281+
3282+
CloseTransientFile(fd);
32813283
}
32823284

32833285

32843286
/*
3285-
* Check whether the TransactionOId 'xid' is in the pre-sorted array 'xip'.
3287+
* Check whether the TransactionOid 'xid' is in the pre-sorted array 'xip'.
32863288
*/
32873289
static bool
32883290
TransactionIdInArray(TransactionId xid, TransactionId *xip, Size num)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy