forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbcbc272
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 was originally committed to master as3036401, but I did not back-patchat the time because the consequences were minor. However, nowthere's been a second report of this causing trouble with a slightlydifferent test case than the one I reported originally, so nowI'm back-patching as far as v11 where JIT was introduced.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. New problemreport from Bharath Rupireddy.Discussion:http://postgr.es/m/CA+TgmobMjnyBfNhGTKQEDbqXYE3_rXWpc4CM63fhyerNCes3mA@mail.gmail.comDiscussion:http://postgr.es/m/CALj2ACWk7j4F2v2fxxYfrroOF=AdFNPr1WsV+AGtHAFQOqm_pw@mail.gmail.com1 parentf87f77e commitbcbc272
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 | |
---|---|---|---|
| |||
11188 | 11188 |
| |
11189 | 11189 |
| |
11190 | 11190 |
| |
| 11191 | + | |
| 11192 | + | |
| 11193 | + | |
11191 | 11194 |
| |
11192 | 11195 |
| |
11193 | 11196 |
| |
| 11197 | + | |
| 11198 | + | |
| 11199 | + | |
11194 | 11200 |
| |
11195 | 11201 |
| |
11196 |
| - | |
| 11202 | + | |
11197 | 11203 |
| |
| 11204 | + | |
| 11205 | + | |
11198 | 11206 |
| |
11199 | 11207 |
| |
11200 | 11208 |
| |
11201 | 11209 |
| |
11202 |
| - | |
| 11210 | + | |
11203 | 11211 |
| |
11204 | 11212 |
| |
11205 | 11213 |
| |
11206 | 11214 |
| |
11207 |
| - | |
11208 | 11215 |
| |
11209 | 11216 |
| |
11210 | 11217 |
| |
| |||
11213 | 11220 |
| |
11214 | 11221 |
| |
11215 | 11222 |
| |
| 11223 | + | |
| 11224 | + | |
| 11225 | + | |
| 11226 | + | |
| 11227 | + | |
| 11228 | + | |
| 11229 | + | |
| 11230 | + | |
| 11231 | + | |
| 11232 | + | |
| 11233 | + | |
| 11234 | + | |
| 11235 | + | |
| 11236 | + | |
| 11237 | + | |
| 11238 | + | |
| 11239 | + | |
| 11240 | + | |
| 11241 | + | |
11216 | 11242 |
| |
11217 | 11243 |
| |
11218 | 11244 |
| |
|
Lines changed: 2 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 | 48 |
| |
61 | 49 |
| |
62 | 50 |
| |
| |||
104 | 92 |
| |
105 | 93 |
| |
106 | 94 |
| |
| 95 | + | |
| 96 | + | |
107 | 97 |
| |
108 | 98 |
| |
109 |
| - | |
110 |
| - | |
111 | 99 |
| |
112 | 100 |
| |
113 | 101 |
| |
| |||
249 | 237 |
| |
250 | 238 |
| |
251 | 239 |
| |
252 |
| - | |
253 | 240 |
| |
254 | 241 |
| |
255 | 242 |
| |
|
Lines changed: 2 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
69 |
| - | |
70 | 69 |
| |
71 | 70 |
| |
72 | 71 |
| |
| |||
231 | 230 |
| |
232 | 231 |
| |
233 | 232 |
| |
234 |
| - | |
235 |
| - | |
236 |
| - | |
237 |
| - | |
238 |
| - | |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 |
| - | |
243 |
| - | |
244 |
| - | |
245 | 233 |
| |
246 | 234 |
| |
247 | 235 |
| |
| |||
280 | 268 |
| |
281 | 269 |
| |
282 | 270 |
| |
283 |
| - | |
| 271 | + | |
284 | 272 |
| |
285 | 273 |
| |
286 | 274 |
| |
| |||
389 | 377 |
| |
390 | 378 |
| |
391 | 379 |
| |
392 |
| - | |
| 380 | + | |
393 | 381 |
| |
394 | 382 |
| |
395 | 383 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
359 | 359 |
| |
360 | 360 |
| |
361 | 361 |
| |
362 |
| - | |
| 362 | + | |
| 363 | + | |
363 | 364 |
| |
364 | 365 |
| |
365 | 366 |
| |
|
0 commit comments
Comments
(0)