1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Revert "Use "transient" files for blind writes, take 2".

This reverts commit fba105b109.
That approach had problems with the smgr-level state not tracking what
we really want to happen, and with the VFD-level state not tracking the
smgr-level state very well either.  In consequence, it was still possible
to hold kernel file descriptors open for long-gone tables (as in recent
report from Tore Halset), and yet there were also cases of FDs being closed
undesirably soon.  A replacement implementation will follow.
This commit is contained in:
Tom Lane
2012-10-17 12:37:20 -04:00
parent f34d1fa0c8
commit cacb65263b
6 changed files with 28 additions and 102 deletions

View File

@@ -165,33 +165,16 @@ smgropen(RelFileNode rnode, BackendId backend)
reln->smgr_targblock = InvalidBlockNumber;
reln->smgr_fsm_nblocks = InvalidBlockNumber;
reln->smgr_vm_nblocks = InvalidBlockNumber;
reln->smgr_transient = false;
reln->smgr_which = 0; /* we only have md.c at present */
/* mark it not open */
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
reln->md_fd[forknum] = NULL;
}
else
/* if it was transient before, it no longer is */
reln->smgr_transient = false;
return reln;
}
/*
* smgrsettransient() -- mark an SMgrRelation object as transaction-bound
*
* The main effect of this is that all opened files are marked to be
* kernel-level closed (but not necessarily VFD-closed) when the current
* transaction ends.
*/
void
smgrsettransient(SMgrRelation reln)
{
reln->smgr_transient = true;
}
/*
* smgrsetowner() -- Establish a long-lived reference to an SMgrRelation object
*