forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6d66058
committed
Revise bgwriter fsync-request mechanism to improve robustness when a table
is deleted. A backend about to unlink a file now sends a "revoke fsync"request to the bgwriter to make it clean out pending fsync requests. Thereis still a race condition where the bgwriter may try to fsync after the unlinkhas happened, but we can resolve that by rechecking the fsync request queueto see if a revoke request arrived meanwhile. This eliminates the formerkluge of "just assuming" that an ENOENT failure is okay, and lets us handlethe fact that on Windows it might be EACCES too without introducing anyquestionable assumptions. After an idea of mine improved by Magnus.The HEAD patch doesn't apply cleanly to 8.2, but I'll see about a back-portlater. In the meantime this could do with some testing on Windows; I've beenable to force it through the code path via ENOENT, but that doesn't prove thatit actually fixes the Windows problem ...1 parent7f58ed1 commit6d66058
2 files changed
+213
-98
lines changedLines changed: 9 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 |
| - | |
| 5 | + | |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| |||
103 | 103 |
| |
104 | 104 |
| |
105 | 105 |
| |
106 |
| - | |
107 |
| - | |
| 106 | + | |
| 107 | + | |
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
| |||
695 | 695 |
| |
696 | 696 |
| |
697 | 697 |
| |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
698 | 703 |
| |
699 | 704 |
| |
700 | 705 |
| |
|
0 commit comments
Comments
(0)