Re: Review: Hot standby - Mailing list pgsql-hackers
From | Pavan Deolasee |
---|---|
Subject | Re: Review: Hot standby |
Date | |
Msg-id | 2e78013d0811210047t1309ee1fr44e726ad793f50ad@mail.gmail.com Whole thread Raw |
In response to | Review: Hot standby ("Pavan Deolasee" <pavan.deolasee@gmail.com>) |
Responses |
Re: Review: Hot standby
("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Re: Review: Hot standby (Simon Riggs <simon@2ndQuadrant.com>) |
List | pgsql-hackers |
<br />I wonder if there is corner case below where there are no WAL records to replay during standby recovery. Specifically,that may cause IsRunningXactDataValid() to return false since latestObservedXid remains set to InvalidTransactionIdand that prevents postmaster from serving read-only clients.<br /><br />I don't have a test case, butI recall seeing the issue while experimenting. Though that could be because of the WALInsertLock issue reported earlier.<br/><br /> /*<br /> * Can we signal Postmaster to enter consistent recovery mode?<br /> *<br /> * There are two points in the log that we must pass. The first<br /> * is minRecoveryPoint, which is the LSN at the time the<br /> * base backup was taken thatwe are about to rollfoward from.<br /> * If recovery has ever crashed or was stopped there is also<br/> * another point also: minSafeStartPoint, which we know the<br /> * latest LSN thatrecovery could have reached prior to crash.<br /> *<br /> * We must also have assembledsufficient information about<br /> * transaction state to allow valid snapshots to be taken.<br/> */<br /> if (!reachedSafeStartPoint &&<br /> IsRunningXactDataValid()&&<br /> XLByteLE(ControlFile->minSafeStartPoint, EndRecPtr) &&<br/> XLByteLE(ControlFile->minRecoveryPoint, EndRecPtr))<br /> {<br /> reachedSafeStartPoint = true;<br /> if (InArchiveRecovery)<br /> {<br /> ereport(LOG,<br /> (errmsg("database has nowreached consistent state at %X/%X",<br /> EndRecPtr.xlogid, EndRecPtr.xrecoff)));<br /> InitRecoveryTransactionEnvironment();<br /> StartCleanupDelayStats();<br/> if (IsUnderPostmaster)<br /> SendPostmasterSignal(PMSIGNAL_RECOVERY_START);<br/> }<br /> }<br /><br /><br />Thanks,<br/>Pavan<br clear="all" /><br />-- <br />Pavan Deolasee<br />EnterpriseDB <a href="http://www.enterprisedb.com">http://www.enterprisedb.com</a><br/>
pgsql-hackers by date: