forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit57c5ad1
committed
Fix possibility of self-deadlock in ResolveRecoveryConflictWithBufferPin().
The tests added in9f8a050 failed nearly reliably on FreeBSD in CI, andoccasionally on the buildfarm. That turns out to be caused not by a bug in thetest, but by a longstanding bug in recovery conflict handling.The standby timeout handler, used by ResolveRecoveryConflictWithBufferPin(),executed SendRecoveryConflictWithBufferPin() inside a signal handler. A badidea, because the deadlock timeout handler (or a spurious latch set) couldhave interrupted ProcWaitForSignal(). If unlucky that could cause aself-deadlock on ProcArrayLock, if the deadlock check is inSendRecoveryConflictWithBufferPin()->CancelDBBackends().To fix, set a flag in StandbyTimeoutHandler(), and check the flag inResolveRecoveryConflictWithBufferPin().Subsequently the recovery conflict tests will be backpatched.Discussion:https://postgr.es/m/20220413002626.udl7lll7f3o7nre7@alap3.anarazel.deBackpatch: 10-1 parent90abe1e commit57c5ad1
1 file changed
+12
-10
lines changedLines changed: 12 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
| 47 | + | |
47 | 48 |
| |
48 | 49 |
| |
49 | 50 |
| |
| |||
603 | 604 |
| |
604 | 605 |
| |
605 | 606 |
| |
606 |
| - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
607 | 611 |
| |
608 | 612 |
| |
609 |
| - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
610 | 616 |
| |
611 | 617 |
| |
612 | 618 |
| |
| |||
632 | 638 |
| |
633 | 639 |
| |
634 | 640 |
| |
| 641 | + | |
635 | 642 |
| |
636 | 643 |
| |
637 | 644 |
| |
| |||
691 | 698 |
| |
692 | 699 |
| |
693 | 700 |
| |
694 |
| - | |
695 |
| - | |
| 701 | + | |
| 702 | + | |
696 | 703 |
| |
697 | 704 |
| |
698 | 705 |
| |
| |||
702 | 709 |
| |
703 | 710 |
| |
704 | 711 |
| |
705 |
| - | |
706 |
| - | |
707 | 712 |
| |
708 | 713 |
| |
709 | 714 |
| |
710 | 715 |
| |
711 |
| - | |
712 |
| - | |
713 |
| - | |
714 |
| - | |
| 716 | + | |
715 | 717 |
| |
716 | 718 |
| |
717 | 719 |
| |
|
0 commit comments
Comments
(0)