forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3036401
committed
Fix minor problems with non-exclusive backup cleanup.
The previous coding imagined that it could call before_shmem_exit()when a non-exclusive backup began and then remove the previously-addedhandler by calling cancel_before_shmem_exit() when that backupended. However, this only works provided that nothing else in thesystem has registered a before_shmem_exit() hook in the interim,because cancel_before_shmem_exit() is documented to remove a callbackonly if it is the latest callback registered. It also only worksif nothing can ERROR out between the time that sessionBackupStateis reset and the time that cancel_before_shmem_exit(), which doesn'tseem to be strictly true.To fix, leave the handler installed for the lifetime of the session,arrange to install it just once, and teach it to quietly do nothing ifthere isn't a non-exclusive backup in process.This is a bug, but for now I'm not going to back-patch, because theconsequences are minor. It's possible to cause a spurious warningto be generated, but that doesn't really matter. It's also possibleto trigger an assertion failure, but production builds shouldn'thave assertions enabled.Patch by me, reviewed by Kyotaro Horiguchi, Michael Paquier (whopreferred a different approach, but got outvoted), Fujii Masao,and Tom Lane, and with comments by various others.Discussion:http://postgr.es/m/CA+TgmobMjnyBfNhGTKQEDbqXYE3_rXWpc4CM63fhyerNCes3mA@mail.gmail.com1 parente975c1a commit3036401
File tree
4 files changed
+35
-33
lines changed- src
- backend
- access/transam
- replication
- include/access
4 files changed
+35
-33
lines changedLines changed: 29 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11133 | 11133 |
| |
11134 | 11134 |
| |
11135 | 11135 |
| |
| 11136 | + | |
| 11137 | + | |
| 11138 | + | |
11136 | 11139 |
| |
11137 | 11140 |
| |
11138 | 11141 |
| |
| 11142 | + | |
| 11143 | + | |
| 11144 | + | |
11139 | 11145 |
| |
11140 | 11146 |
| |
11141 |
| - | |
| 11147 | + | |
11142 | 11148 |
| |
| 11149 | + | |
| 11150 | + | |
11143 | 11151 |
| |
11144 | 11152 |
| |
11145 | 11153 |
| |
11146 | 11154 |
| |
11147 |
| - | |
| 11155 | + | |
11148 | 11156 |
| |
11149 | 11157 |
| |
11150 | 11158 |
| |
11151 | 11159 |
| |
11152 |
| - | |
11153 | 11160 |
| |
11154 | 11161 |
| |
11155 | 11162 |
| |
| |||
11158 | 11165 |
| |
11159 | 11166 |
| |
11160 | 11167 |
| |
| 11168 | + | |
| 11169 | + | |
| 11170 | + | |
| 11171 | + | |
| 11172 | + | |
| 11173 | + | |
| 11174 | + | |
| 11175 | + | |
| 11176 | + | |
| 11177 | + | |
| 11178 | + | |
| 11179 | + | |
| 11180 | + | |
| 11181 | + | |
| 11182 | + | |
| 11183 | + | |
| 11184 | + | |
| 11185 | + | |
| 11186 | + | |
11161 | 11187 |
| |
11162 | 11188 |
| |
11163 | 11189 |
| |
|
Lines changed: 2 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 | 47 |
| |
60 | 48 |
| |
61 | 49 |
| |
| |||
103 | 91 |
| |
104 | 92 |
| |
105 | 93 |
| |
| 94 | + | |
| 95 | + | |
106 | 96 |
| |
107 | 97 |
| |
108 |
| - | |
109 |
| - | |
110 | 98 |
| |
111 | 99 |
| |
112 | 100 |
| |
| |||
248 | 236 |
| |
249 | 237 |
| |
250 | 238 |
| |
251 |
| - | |
252 | 239 |
| |
253 | 240 |
| |
254 | 241 |
| |
|
Lines changed: 2 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
68 |
| - | |
69 | 68 |
| |
70 | 69 |
| |
71 | 70 |
| |
| |||
216 | 215 |
| |
217 | 216 |
| |
218 | 217 |
| |
219 |
| - | |
220 |
| - | |
221 |
| - | |
222 |
| - | |
223 |
| - | |
224 |
| - | |
225 |
| - | |
226 |
| - | |
227 |
| - | |
228 |
| - | |
229 |
| - | |
230 | 218 |
| |
231 | 219 |
| |
232 | 220 |
| |
| |||
265 | 253 |
| |
266 | 254 |
| |
267 | 255 |
| |
268 |
| - | |
| 256 | + | |
269 | 257 |
| |
270 | 258 |
| |
271 | 259 |
| |
| |||
374 | 362 |
| |
375 | 363 |
| |
376 | 364 |
| |
377 |
| - | |
| 365 | + | |
378 | 366 |
| |
379 | 367 |
| |
380 | 368 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
349 | 349 |
| |
350 | 350 |
| |
351 | 351 |
| |
352 |
| - | |
| 352 | + | |
| 353 | + | |
353 | 354 |
| |
354 | 355 |
| |
355 | 356 |
| |
|
0 commit comments
Comments
(0)