STANDBY_LOCK_TIMEOUT may not interrupt ProcWaitForSignal()? - Mailing list pgsql-hackers

From Fujii Masao
Subject STANDBY_LOCK_TIMEOUT may not interrupt ProcWaitForSignal()?
Date
Msg-id db440eee-43a0-0874-2e24-0883c1d2ce75@oss.nttdata.com
Whole thread Raw
Responses Re: STANDBY_LOCK_TIMEOUT may not interrupt ProcWaitForSignal()?
List pgsql-hackers
Hi,

When the startup process needs to wait for recovery conflict on lock,
STANDBY_LOCK_TIMEOUT is enabled to interrupt ProcWaitForSignal()
if necessary. If this timeout happens, StandbyLockTimeoutHandler() is
called and this function does nothing as follows.

     /*
      * StandbyLockTimeoutHandler() will be called if STANDBY_LOCK_TIMEOUT is exceeded.
      * This doesn't need to do anything, simply waking up is enough.
      */
     void
     StandbyLockTimeoutHandler(void)
     {
     }

But if STANDBY_LOCK_TIMEOUT happens just before entering ProcWaitForSignal(),
the timeout fails to interrupt that wait. Also a signal sent by this timeout
doesn't interrupt poll() used in ProcWaitForSignal(), on all platforms.

So I think that StandbyLockTimeoutHandler() should do SetLatch(MyLatch)
so that the timeout can interrupt ProcWaitForSignal() even in those cases.
Thought?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



pgsql-hackers by date:

Previous
From: Ajin Cherian
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Next
From: wenjing zeng
Date:
Subject: Re: [Proposal] Global temporary tables