forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3e1683d
committed
Fix, or at least ameliorate, bugs in logicalrep_worker_launch().
If we failed to get a background worker slot, the code just walkedaway from the logicalrep-worker slot it already had, leaving thatlooking like the worker is still starting up. This led to an indefinitehang in subscription startup, as reported by Thomas Munro. We mustrelease the slot on failure.Also fix a thinko: we must capture the worker slot's generation beforereleasing LogicalRepWorkerLock the first time, else testing to see ifit's changed is pretty meaningless.BTW, the CHECK_FOR_INTERRUPTS() in WaitForReplicationWorkerAttach is aticking time bomb, even without considering the possibility of elog(ERROR)in one of the other functions it calls. Really, this entire business needsa redesign with some actual thought about error recovery. But for nowI'm just band-aiding the case observed in testing.Back-patch to v10 where this code was added.Discussion:https://postgr.es/m/CAEepm=2bP3TBMFBArP6o20AZaRduWjMnjCjt22hSdnA-EvrtCw@mail.gmail.com1 parent4b17c89 commit3e1683d
1 file changed
+13
-6
lines changedLines changed: 13 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
168 | 168 |
| |
169 | 169 |
| |
170 | 170 |
| |
| 171 | + | |
171 | 172 |
| |
172 | 173 |
| |
173 | 174 |
| |
174 | 175 |
| |
175 |
| - | |
176 |
| - | |
177 |
| - | |
178 |
| - | |
179 | 176 |
| |
180 | 177 |
| |
181 | 178 |
| |
| |||
282 | 279 |
| |
283 | 280 |
| |
284 | 281 |
| |
285 |
| - | |
| 282 | + | |
286 | 283 |
| |
287 | 284 |
| |
288 | 285 |
| |
289 | 286 |
| |
290 | 287 |
| |
291 | 288 |
| |
292 | 289 |
| |
| 290 | + | |
293 | 291 |
| |
294 | 292 |
| |
295 | 293 |
| |
| |||
406 | 404 |
| |
407 | 405 |
| |
408 | 406 |
| |
| 407 | + | |
| 408 | + | |
| 409 | + | |
409 | 410 |
| |
410 | 411 |
| |
411 | 412 |
| |
| |||
428 | 429 |
| |
429 | 430 |
| |
430 | 431 |
| |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
431 | 438 |
| |
432 | 439 |
| |
433 | 440 |
| |
| |||
436 | 443 |
| |
437 | 444 |
| |
438 | 445 |
| |
439 |
| - | |
| 446 | + | |
440 | 447 |
| |
441 | 448 |
| |
442 | 449 |
| |
|
0 commit comments
Comments
(0)