forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1b468a1
committed
Fix the fallback memory barrier implementation to be reentrant.
This was essentially "broken" since0c8eda6; but until morerecently (14e8803) barriers usage in signal handlers was infrequent.The failure to be reentrant was noticed because the test_shm_mq, whichuses memory barriers at a high frequency, occasionally got stuck on somesolaris buildfarm animals. Turns out, those machines use sun studio12.1, which doesn't yet have efficient memory barrier support. A machinewith a newer sun studio did not fail. Forcing the barrier fallback tobe used on x86 allows to reproduce the problem.The new fallback is to use kill(PostmasterPid, 0) based on the theorythat that'll always imply a barrier due to checking the liveliness ofPostmasterPid on systems old enough to need fallback support. It's hardto come up with a good and performant fallback.I'm not backpatching this for now - the problem isn't active in the backbranches, and we haven't backpatched barrier changes fornow. Additionally master looks entirely different than the back branchesdue to the new atomics abstraction. It seems better to let this rest inmaster, where the non-reentrancy actively causes a problem, and thenconsider backpatching.Found-By: Robert HaasDiscussion: 55626265.3060800@dunslane.net1 parent5ca6118 commit1b468a1
1 file changed
+19
-2
lines changedLines changed: 19 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
26 | 35 |
| |
27 | 36 |
| |
28 | 37 |
| |
29 | 38 |
| |
30 |
| - | |
31 |
| - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
32 | 49 |
| |
33 | 50 |
| |
34 | 51 |
| |
|
0 commit comments
Comments
(0)