mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Revert "Get rid of the dedicated latch for signaling the startup process".
Revertac22929a26
, as well as the followup fix113d3591b8
. Because it broke the assumption that the startup process waiting for the recovery conflict on buffer pin should be waken up only by buffer unpin or the timeout enabled in ResolveRecoveryConflictWithBufferPin(). It caused, for example, SIGHUP signal handler or walreceiver process to wake that startup process up unnecessarily frequently. Additionally, add the comments about why that dedicated latch that the reverted patch tried to get rid of should not be removed. Thanks to Kyotaro Horiguchi for the discussion. Author: Fujii Masao Discussion: https://postgr.es/m/d8c0c608-021b-3c73-fffd-3240829ee986@oss.nttdata.com
This commit is contained in:
@@ -519,7 +519,14 @@ ResolveRecoveryConflictWithBufferPin(void)
|
||||
enable_timeouts(timeouts, 2);
|
||||
}
|
||||
|
||||
/* Wait to be signaled by UnpinBuffer() */
|
||||
/*
|
||||
* Wait to be signaled by UnpinBuffer().
|
||||
*
|
||||
* We assume that only UnpinBuffer() and the timeout requests established
|
||||
* above can wake us up here. WakeupRecovery() called by walreceiver or
|
||||
* SIGHUP signal handler, etc cannot do that because it uses the different
|
||||
* latch from that ProcWaitForSignal() waits on.
|
||||
*/
|
||||
ProcWaitForSignal(PG_WAIT_BUFFER_PIN);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user