- Notifications
You must be signed in to change notification settings - Fork5
Commit68c3234
committed
Repair a bunch of problems in md.c. This builds on Hiroshi's
insight that RelationFlushRelation ought to invoke smgrclose, and that theway to make that work is to ensure that mdclose doesn't fail if the relationis already closed (or unlinked, if we are looking at a DROP TABLE). WhileI was testing that, I was able to identify several problems that we hadwith multiple-segment relations. The system is now able to do initdb andpass the regression tests with a very small segment size (I had it set to64Kb per segment for testing). I don't believe that ever worked before.File descriptor leaks seem to be gone too.I have partially addressed the concerns we had about mdtruncate(), too.On a Win32 or NFS filesystem it is not possible to unlink a file thatanother backend is holding open, so what md.c now does is to truncateunwanted files to zero length before trying to unlink them. The otherbackends will be forced to close their open files by relation cacheinvalidation --- but I think it would take considerable work to makethat happen before vacuum truncates the relation rather than after.Leaving zero-length files lying around seems a usable compromise.1 parent4478d29 commit68c3234
3 files changed
+154
-112
lines changed0 commit comments
Comments
(0)