]> granicus.if.org Git - postgresql/commit
Flush logical mapping files with fd opened for read/write at checkpoint
authorMichael Paquier <michael@paquier.xyz>
Wed, 9 Oct 2019 04:31:33 +0000 (13:31 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 9 Oct 2019 04:31:33 +0000 (13:31 +0900)
commitc50f95272e5c058bfec31dc84f0cd115557178b3
tree43d691f1c313b0074a6247fe578abca335cb0dfe
parent4fe04a62c584647ea4c57b73a86f5b69a30e5829
Flush logical mapping files with fd opened for read/write at checkpoint

The file descriptor was opened with read-only to fsync a regular file,
which would cause EBADFD errors on some platforms.

This is similar to the recent fix done by a586cc4b (which was broken by
me with 82a5649), except that I noticed this issue while monitoring the
backend code for similar mistakes.  Backpatch to 9.4, as this has been
introduced since logical decoding exists as of b89e151.

Author: Michael Paquier
Reviewed-by: Andres Freund
Discussion: https://postgr.es/m/20191006045548.GA14532@paquier.xyz
Backpatch-through: 9.4
src/backend/access/heap/rewriteheap.c