summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xact.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-02-13 16:15:48 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-02-13 16:15:48 +0000
commitdd428c79a4d89867758443b7b5aac45137685f11 (patch)
treecf6c4d95ef6105a9edd1a3b80b22c238358da1e3 /src/backend/access/transam/xact.c
parenta5acb7dfb94391c7b19691786186033993d82b34 (diff)
Fix relcache init file invalidation during Hot Standby for the case
where a database has a non-default tablespaceid. Pass thru MyDatabaseId and MyDatabaseTableSpace to allow file path to be re-created in standby and correct invalidation to take place in all cases. Update and rework xact_commit_desc() debug messages. Bug report from Tom by code inspection. Fix by me.
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r--src/backend/access/transam/xact.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 27ce9ac4c30..c239c098fd6 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.284 2010/02/08 04:33:53 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.285 2010/02/13 16:15:46 sriggs Exp $
*
*-------------------------------------------------------------------------
*/
@@ -951,6 +951,9 @@ RecordTransactionCommit(void)
if (forceSyncCommit)
xlrec.xinfo |= XACT_COMPLETION_FORCE_SYNC_COMMIT;
+ xlrec.dbId = MyDatabaseId;
+ xlrec.tsId = MyDatabaseTableSpace;
+
/*
* Mark ourselves as within our "commit critical section". This
* forces any concurrent checkpoint to wait until we've updated
@@ -4412,7 +4415,8 @@ xact_redo_commit(xl_xact_commit *xlrec, TransactionId xid, XLogRecPtr lsn)
* as occurs in .
*/
ProcessCommittedInvalidationMessages(inval_msgs, xlrec->nmsgs,
- XactCompletionRelcacheInitFileInval(xlrec));
+ XactCompletionRelcacheInitFileInval(xlrec),
+ xlrec->dbId, xlrec->tsId);
/*
* Release locks, if any. We do this for both two phase and normal
@@ -4596,15 +4600,11 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
{
int i;
TransactionId *xacts;
- SharedInvalidationMessage *msgs;
xacts = (TransactionId *) &xlrec->xnodes[xlrec->nrels];
- msgs = (SharedInvalidationMessage *) &xacts[xlrec->nsubxacts];
-
- if (XactCompletionRelcacheInitFileInval(xlrec))
- appendStringInfo(buf, "; relcache init file inval");
appendStringInfoString(buf, timestamptz_to_str(xlrec->xact_time));
+
if (xlrec->nrels > 0)
{
appendStringInfo(buf, "; rels:");
@@ -4624,6 +4624,14 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
}
if (xlrec->nmsgs > 0)
{
+ SharedInvalidationMessage *msgs;
+
+ msgs = (SharedInvalidationMessage *) &xacts[xlrec->nsubxacts];
+
+ if (XactCompletionRelcacheInitFileInval(xlrec))
+ appendStringInfo(buf, "; relcache init file inval dbid %u tsid %u",
+ xlrec->dbId, xlrec->tsId);
+
appendStringInfo(buf, "; inval msgs:");
for (i = 0; i < xlrec->nmsgs; i++)
{