diff options
author | Andres Freund <andres@anarazel.de> | 2022-05-02 18:25:00 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2022-05-02 18:25:59 -0700 |
commit | 9ab3b2bdbb5dc4ff857685eae5645d7c35839055 (patch) | |
tree | c3b57a23979b13e14614c795e5b715321d820f20 /src/backend/utils/adt/regexp.c | |
parent | 5ab8e8014801dd6bc05809e7ba994c013e9ee86b (diff) | |
download | postgresql-9ab3b2bdbb5dc4ff857685eae5645d7c35839055.tar.gz postgresql-9ab3b2bdbb5dc4ff857685eae5645d7c35839055.zip |
Fix possibility of self-deadlock in ResolveRecoveryConflictWithBufferPin().
The tests added in 9f8a050f68d failed nearly reliably on FreeBSD in CI, and
occasionally on the buildfarm. That turns out to be caused not by a bug in the
test, but by a longstanding bug in recovery conflict handling.
The standby timeout handler, used by ResolveRecoveryConflictWithBufferPin(),
executed SendRecoveryConflictWithBufferPin() inside a signal handler. A bad
idea, because the deadlock timeout handler (or a spurious latch set) could
have interrupted ProcWaitForSignal(). If unlucky that could cause a
self-deadlock on ProcArrayLock, if the deadlock check is in
SendRecoveryConflictWithBufferPin()->CancelDBBackends().
To fix, set a flag in StandbyTimeoutHandler(), and check the flag in
ResolveRecoveryConflictWithBufferPin().
Subsequently the recovery conflict tests will be backpatched.
Discussion: https://postgr.es/m/20220413002626.udl7lll7f3o7nre7@alap3.anarazel.de
Backpatch: 10-
Diffstat (limited to 'src/backend/utils/adt/regexp.c')
0 files changed, 0 insertions, 0 deletions