mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Derive oldestActiveXid at correct time for Hot Standby.
There was a timing window between when oldestActiveXid was derived and when it should have been derived that only shows itself under heavy load. Move code around to ensure correct timing of derivation. No change to StartupSUBTRANS() code, which is where this failed. Bug report by Chris Redekop
This commit is contained in:
@ -815,7 +815,7 @@ standby_desc(StringInfo buf, uint8 xl_info, char *rec)
|
||||
* making WAL entries.
|
||||
*/
|
||||
void
|
||||
LogStandbySnapshot(TransactionId *oldestActiveXid, TransactionId *nextXid)
|
||||
LogStandbySnapshot(TransactionId *nextXid)
|
||||
{
|
||||
RunningTransactions running;
|
||||
xl_standby_lock *locks;
|
||||
@ -845,7 +845,6 @@ LogStandbySnapshot(TransactionId *oldestActiveXid, TransactionId *nextXid)
|
||||
/* GetRunningTransactionData() acquired XidGenLock, we must release it */
|
||||
LWLockRelease(XidGenLock);
|
||||
|
||||
*oldestActiveXid = running->oldestRunningXid;
|
||||
*nextXid = running->nextXid;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user