mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Include the backend ID in the relpath of temporary relations.
This allows us to reliably remove all leftover temporary relation files on cluster startup without reference to system catalogs or WAL; therefore, we no longer include temporary relations in XLOG_XACT_COMMIT and XLOG_XACT_ABORT WAL records. Since these changes require including a backend ID in each SharedInvalSmgrMsg, the size of the SharedInvalidationMessage.id field has been reduced from two bytes to one, and the maximum number of connections has been reduced from INT_MAX / 4 to 2^23-1. It would be possible to remove these restrictions by increasing the size of SharedInvalidationMessage by 4 bytes, but right now that doesn't seem like a good trade-off. Review by Jaime Casanova and Tom Lane.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.339 2010/08/05 14:45:01 rhaas Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.340 2010/08/13 20:10:51 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -7165,13 +7165,13 @@ ATExecSetTableSpace(Oid tableOid, Oid newTableSpace, LOCKMODE lockmode)
|
||||
* Relfilenodes are not unique across tablespaces, so we need to allocate
|
||||
* a new one in the new tablespace.
|
||||
*/
|
||||
newrelfilenode = GetNewRelFileNode(newTableSpace, NULL);
|
||||
newrelfilenode = GetNewRelFileNode(newTableSpace, NULL, rel->rd_backend);
|
||||
|
||||
/* Open old and new relation */
|
||||
newrnode = rel->rd_node;
|
||||
newrnode.relNode = newrelfilenode;
|
||||
newrnode.spcNode = newTableSpace;
|
||||
dstrel = smgropen(newrnode);
|
||||
dstrel = smgropen(newrnode, rel->rd_backend);
|
||||
|
||||
RelationOpenSmgr(rel);
|
||||
|
||||
@ -7262,7 +7262,7 @@ copy_relation_data(SMgrRelation src, SMgrRelation dst,
|
||||
|
||||
/* XLOG stuff */
|
||||
if (use_wal)
|
||||
log_newpage(&dst->smgr_rnode, forkNum, blkno, page);
|
||||
log_newpage(&dst->smgr_rnode.node, forkNum, blkno, page);
|
||||
|
||||
/*
|
||||
* Now write the page. We say isTemp = true even if it's not a temp
|
||||
|
Reference in New Issue
Block a user