- Notifications
You must be signed in to change notification settings - Fork5
Commit8ff5186
committed
Fix confusion of max_parallel_workers mechanism following crash.
Commitb460f5d failed to contemplatethe possibilit that a parallel worker registered before a crash wouldbe unregistered only after the crash; if that happened, we'd end upwith parallel_terminate_count > parallel_register_count and thesystem would refuse to launch any more parallel workers.The easiest way to fix that seems to be to forget BGW_NEVER_RESTARTworkers in ResetBackgroundWorkerCrashTimes() rather than leaving themaround to be cleaned up after the conclusion of the restart, so thatthey go away before rather than after shared memory is reset.To make sure that this fix is water-tight, don't allow parallelworkers to be anything other than BGW_NEVER_RESTART, so that afterrecovering from a crash, 0 is guaranteed to be the correct startingvalue for parallel_register_count. The core code wouldn't do thisanyway, but somebody might try to do it in extension code.Report by Thomas Vondra. Patch by me, reviewed by Kuntal Ghosh.Discussion:http://postgr.es/m/CAGz5QC+AVEVS+3rBKRq83AxkJLMZ1peMt4nnrQwczxOrmo3CNw@mail.gmail.com1 parent1e298b8 commit8ff5186
1 file changed
+42
-6
lines changedLines changed: 42 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
515 | 515 |
| |
516 | 516 |
| |
517 | 517 |
| |
518 |
| - | |
519 |
| - | |
520 |
| - | |
521 |
| - | |
522 |
| - | |
523 |
| - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
524 | 544 |
| |
| 545 | + | |
525 | 546 |
| |
526 | 547 |
| |
527 | 548 |
| |
| |||
589 | 610 |
| |
590 | 611 |
| |
591 | 612 |
| |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
592 | 628 |
| |
593 | 629 |
| |
594 | 630 |
| |
|
0 commit comments
Comments
(0)