diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2009-12-03 11:04:03 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2009-12-03 11:04:03 +0000 |
commit | b9c44be65ffa9b26c72e548292ac81c3f17cf7f7 (patch) | |
tree | 05501b95bd18e14c3252928273e4f9724c04c0d7 /src/include | |
parent | 532ae854ccc5527906dccdcbaf7ca5d5c533d8f7 (diff) |
Fix bug in temporary file management with subtransactions. A cursor opened
in a subtransaction stays open even if the subtransaction is aborted, so
any temporary files related to it must stay alive as well. With the patch,
we use ResourceOwners to track open temporary files and don't automatically
close them at subtransaction end (though in the normal case temporary files
are registered with the subtransaction resource owner and will therefore be
closed).
At end of top transaction, we still check that there's no temporary files
marked as close-at-end-of-transaction open, but that's now just a debugging
cross-check as the resource owner cleanup should've closed them already.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/utils/resowner.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/utils/resowner.h b/src/include/utils/resowner.h index 11e6f4eee2d..28d1ca51627 100644 --- a/src/include/utils/resowner.h +++ b/src/include/utils/resowner.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/resowner.h,v 1.5 2004/12/31 22:03:46 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/utils/resowner.h,v 1.5.6.1 2009/12/03 11:04:03 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -20,6 +20,7 @@ #define RESOWNER_H #include "storage/buf.h" +#include "storage/fd.h" #include "utils/catcache.h" #include "utils/rel.h" @@ -107,4 +108,11 @@ extern void ResourceOwnerRememberRelationRef(ResourceOwner owner, extern void ResourceOwnerForgetRelationRef(ResourceOwner owner, Relation rel); +/* support for temporary file management */ +extern void ResourceOwnerEnlargeFiles(ResourceOwner owner); +extern void ResourceOwnerRememberFile(ResourceOwner owner, + File file); +extern void ResourceOwnerForgetFile(ResourceOwner owner, + File file); + #endif /* RESOWNER_H */ |