forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit44445b2
committed
Set the process latch when processing recovery conflict interrupts.
Because RecoveryConflictInterrupt() didn't set the process latchanything using the latter to wait for events didn't get notified aboutrecovery conflicts. Most latch users are never the target of recoveryconflicts, which explains the lack of reports about this untilnow.Since 9.3 two possible affected users exist though: The sql callablepg_sleep() now uses latches to wait and background workers areexpected to use latches in their main loop. Both would currently waituntil the end of WaitLatch's timeout.Fix by adding a SetLatch() to RecoveryConflictInterrupt(). It'd alsobe possible to fix the issue by having each latch user setset_latch_on_sigusr1. That seems failure prone and though, as most ofthese callsites won't often receive recovery conflicts and thus willlikely only be tested against normal query cancels et al. It'd also beunnecessarily verbose.Backpatch to 9.1 where latches were introduced. Arguably 9.3 would besufficient, because that's where pg_sleep() was converted to waitingon the latch and background workers got introduced; but there could beuser level code making use of the latch pre 9.3.1 parent5eebb8d commit44445b2
1 file changed
+10
-0
lines changedLines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2806 | 2806 |
| |
2807 | 2807 |
| |
2808 | 2808 |
| |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
2809 | 2819 |
| |
2810 | 2820 |
| |
2811 | 2821 |
| |
|
0 commit comments
Comments
(0)