]> granicus.if.org Git - postgresql/commit
Fix bug in temporary file management with subtransactions. A cursor opened
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 3 Dec 2009 11:03:44 +0000 (11:03 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 3 Dec 2009 11:03:44 +0000 (11:03 +0000)
commitdd7321f81ca7b87b986ac571857368454d5f3d8f
treed42cb27489183755b4de23cdab03ce59c88d32b5
parent3c77fbd285a9109ef7b341ad3cc7e50121bed161
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.
src/backend/storage/file/fd.c
src/backend/utils/resowner/resowner.c
src/include/utils/resowner.h