forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita586cc4
committed
Use a fd opened for read/write when syncing slots during startup, take 2.
Cribbing fromdfbaed4: 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 this fix was undone in82a5649. Re-apply, and add acomment.Bug: 16039Reported-By: Hans BuschmannAuthor: Andres FreundDiscussion:https://postgr.es/m/16039-196fc97cc05e141c@postgresql.orgBackpatch: 12-, as82a56491 parentad7595b commita586cc4
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1386 | 1386 |
| |
1387 | 1387 |
| |
1388 | 1388 |
| |
1389 |
| - | |
| 1389 | + | |
| 1390 | + | |
1390 | 1391 |
| |
1391 | 1392 |
| |
1392 | 1393 |
| |
|
0 commit comments
Comments
(0)