- Notifications
You must be signed in to change notification settings - Fork28
Commit4e2d5ef
committed
On Windows, when a file is deleted and another process still has an open
file handle on it, the file goes into "pending deletion" state where itstill shows up in directory listing, but isn't accessible otherwise. Thatconfuses RemoveOldXLogFiles(), making it think that the file hasn't beenarchived yet, while it actually was, and it was deleted along with the .donefile.Fix that by renaming the file with ".deleted" extension before deleting it.Also check the return value of rename() and unlink(), so that if the removalfails for any reason (e.g another process is holding the file locked), wedon't delete the .done file until the WAL file is really gone.Backpatch to 8.2, which is the oldest version supported on Windows.1 parent3ab8b7f commit4e2d5ef
1 file changed
+36
-2
lines changedLines changed: 36 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
3040 | 3040 |
| |
3041 | 3041 |
| |
3042 | 3042 |
| |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
3043 | 3046 |
| |
3044 | 3047 |
| |
3045 | 3048 |
| |
| |||
3103 | 3106 |
| |
3104 | 3107 |
| |
3105 | 3108 |
| |
| 3109 | + | |
| 3110 | + | |
3106 | 3111 |
| |
3107 | 3112 |
| |
3108 | 3113 |
| |
3109 |
| - | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
3110 | 3144 |
| |
3111 | 3145 |
| |
3112 | 3146 |
| |
|
0 commit comments
Comments
(0)