forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8f1537d
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 parent21e1844 commit8f1537d
1 file changed
+10
-10
lines changedLines changed: 10 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| |||
793 | 794 |
| |
794 | 795 |
| |
795 | 796 |
| |
796 |
| - | |
| 797 | + | |
| 798 | + | |
797 | 799 |
| |
798 | 800 |
| |
799 | 801 |
| |
| |||
802 | 804 |
| |
803 | 805 |
| |
804 | 806 |
| |
805 |
| - | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
806 | 810 |
| |
807 | 811 |
| |
808 | 812 |
| |
| |||
828 | 832 |
| |
829 | 833 |
| |
830 | 834 |
| |
| 835 | + | |
831 | 836 |
| |
832 | 837 |
| |
833 | 838 |
| |
| |||
887 | 892 |
| |
888 | 893 |
| |
889 | 894 |
| |
890 |
| - | |
891 |
| - | |
| 895 | + | |
| 896 | + | |
892 | 897 |
| |
893 | 898 |
| |
894 | 899 |
| |
| |||
898 | 903 |
| |
899 | 904 |
| |
900 | 905 |
| |
901 |
| - | |
902 |
| - | |
903 | 906 |
| |
904 | 907 |
| |
905 | 908 |
| |
906 | 909 |
| |
907 |
| - | |
908 |
| - | |
909 |
| - | |
910 |
| - | |
| 910 | + | |
911 | 911 |
| |
912 | 912 |
| |
913 | 913 |
| |
|
0 commit comments
Comments
(0)