forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdfbaed4
committed
Use a fd opened for read/write when syncing slots during startup.
Some operating systems, including the reporter's windows, return EBADFDor similar when fsync() is invoked on a O_RDONLY file descriptor.Unfortunately RestoreSlotFromDisk() does exactly that; which causesfailures after restarts in at least some scenarios.If you hit the bug the error message will be something likeERROR: could not fsync file "pg_replslot/$name/state": Bad file descriptorSimply use O_RDWR instead of O_RDONLY when opening the relevant filedescriptor to fix the bug. Unfortunately I have no way of verifying thefix, but we've seen similar problems in the past.This bug goes back to 9.4 where slots were introduced. Backpatchaccordingly.Reported-By: Patrice DroletBug: #13143:Discussion: 20150424101006.2556.60897@wrigleys.postgresql.org1 parentdcbf594 commitdfbaed4
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1092 | 1092 |
| |
1093 | 1093 |
| |
1094 | 1094 |
| |
1095 |
| - | |
| 1095 | + | |
1096 | 1096 |
| |
1097 | 1097 |
| |
1098 | 1098 |
| |
|
0 commit comments
Comments
(0)