diff options
author | Andres Freund <andres@anarazel.de> | 2015-04-28 00:12:38 +0200 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2015-04-28 00:18:04 +0200 |
commit | fd3dfc236c155048caf21c35e23e8dadc89895ec (patch) | |
tree | cc7aac5f6df5ead16f5c32b8b514945bf3cd7151 /contrib/btree_gist | |
parent | 5f3d1909c58aee1911d4b1e7f643bb8db09e8da6 (diff) |
Use a fd opened for read/write when syncing slots during startup.
Some operating systems, including the reporter's windows, return EBADFD
or similar when fsync() is invoked on a O_RDONLY file descriptor.
Unfortunately RestoreSlotFromDisk() does exactly that; which causes
failures after restarts in at least some scenarios.
If you hit the bug the error message will be something like
ERROR: could not fsync file "pg_replslot/$name/state": Bad file descriptor
Simply use O_RDWR instead of O_RDONLY when opening the relevant file
descriptor to fix the bug. Unfortunately I have no way of verifying the
fix, but we've seen similar problems in the past.
This bug goes back to 9.4 where slots were introduced. Backpatch
accordingly.
Reported-By: Patrice Drolet
Bug: #13143:
Discussion: 20150424101006.2556.60897@wrigleys.postgresql.org
Diffstat (limited to 'contrib/btree_gist')
0 files changed, 0 insertions, 0 deletions