On 04/11/2020 14:03, Fujii Masao wrote:
>> I'm thinking to remove the following code to fix this issue. Thought?
>>
>> /*
>> * We don't need the latch anymore. It's not strictly necessary to reset
>> * it to NULL, but let's do it for the sake of tidiness.
>> */
>> if (ArchiveRecoveryRequested)
>> XLogCtl->recoveryWakeupLatch = NULL;
That should work, but it seems a bit sloppy to leave it pointing to a
latch that belongs to a random process though.
> Or ISTM that WakeupRecovery() should set the latch only when the latch
> has not been reset to NULL yet.
Got to be careful with race conditions, if the latch is set to NULL at
the same time that WakeupRecovery() is called.
- Heikki