mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
During Hot Standby, set DatabasePath correctly during relcache init file
deletion, so that we attempt to unlink the correct filepath. unlink() errors are ignorable there, so lack of a DatabasePath initialization step did not cause visible problems until a related bug showed up on Solaris. Code refactored from xact_redo_commit() to ProcessCommittedInvalidationMessages() in inval.c. Recovery may replay shared invalidation messages for many databases, so we cannot SetDatabasePath() once as we do in normal backends. Read the databaseid from the shared invalidation messages, then set DatabasePath temporarily before calling RelationCacheInitFileInvalidate(). Problem report by Robert Treat, analysis and fix by me.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.279 2010/01/02 16:57:35 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.280 2010/01/09 16:49:27 sriggs Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -4404,20 +4404,8 @@ xact_redo_commit(xl_xact_commit *xlrec, TransactionId xid, XLogRecPtr lsn)
|
||||
* maintain the same order of invalidation then release locks
|
||||
* as occurs in .
|
||||
*/
|
||||
if (xlrec->nmsgs > 0)
|
||||
{
|
||||
/*
|
||||
* Relcache init file invalidation requires processing both
|
||||
* before and after we send the SI messages. See AtEOXact_Inval()
|
||||
*/
|
||||
if (XactCompletionRelcacheInitFileInval(xlrec))
|
||||
RelationCacheInitFileInvalidate(true);
|
||||
|
||||
SendSharedInvalidMessages(inval_msgs, xlrec->nmsgs);
|
||||
|
||||
if (XactCompletionRelcacheInitFileInval(xlrec))
|
||||
RelationCacheInitFileInvalidate(false);
|
||||
}
|
||||
ProcessCommittedInvalidationMessages(inval_msgs, xlrec->nmsgs,
|
||||
XactCompletionRelcacheInitFileInval(xlrec));
|
||||
|
||||
/*
|
||||
* Release locks, if any. We do this for both two phase and normal
|
||||
|
Reference in New Issue
Block a user