forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitedfc03e
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 parent5c8b14a commitedfc03e
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 |
| |
| |||
595 | 596 |
| |
596 | 597 |
| |
597 | 598 |
| |
598 |
| - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
599 | 603 |
| |
600 | 604 |
| |
601 |
| - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
602 | 608 |
| |
603 | 609 |
| |
604 | 610 |
| |
| |||
624 | 630 |
| |
625 | 631 |
| |
626 | 632 |
| |
| 633 | + | |
627 | 634 |
| |
628 | 635 |
| |
629 | 636 |
| |
| |||
683 | 690 |
| |
684 | 691 |
| |
685 | 692 |
| |
686 |
| - | |
687 |
| - | |
| 693 | + | |
| 694 | + | |
688 | 695 |
| |
689 | 696 |
| |
690 | 697 |
| |
| |||
694 | 701 |
| |
695 | 702 |
| |
696 | 703 |
| |
697 |
| - | |
698 |
| - | |
699 | 704 |
| |
700 | 705 |
| |
701 | 706 |
| |
702 | 707 |
| |
703 |
| - | |
704 |
| - | |
705 |
| - | |
706 |
| - | |
| 708 | + | |
707 | 709 |
| |
708 | 710 |
| |
709 | 711 |
| |
|
0 commit comments
Comments
(0)