OSDN Git Service

During Hot Standby, set DatabasePath correctly during relcache init file
authorSimon Riggs <simon@2ndQuadrant.com>
Sat, 9 Jan 2010 16:49:27 +0000 (16:49 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Sat, 9 Jan 2010 16:49:27 +0000 (16:49 +0000)
commit42edbd16fbfa95883b6c8449c9e567500514381c
tree5ad03385bc395a4cd7cb8797f4bfc40b1a122e64
parent510f3502ebb43afd3e05fa5b67352fe5a6db20bc
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.
src/backend/access/transam/xact.c
src/backend/utils/cache/inval.c
src/include/storage/sinval.h