Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08fdfe7

Browse files
committed
Fix mdtruncate() to close fd.c handle of deleted segments.
mdtruncate() forgot to FileClose() a segment's mdfd_vfd, when deletingit. That lead to a fd.c handle to a truncated file being kept open untilbackend exit.The issue appears to have been introduced way back in1a5c450,before that the handle was closed inside FileUnlink().The impact of this bug is limited - only VACUUM and ON COMMIT TRUNCATEfor temporary tables, truncate files in place (i.e. TRUNCATE itself isnot affected), and the relation has to be bigger than 1GB. Theconsequences of a leaked fd.c handle aren't severe either.Discussion: <20160908220748.oqh37ukwqqncbl3n@alap3.anarazel.de>Backpatch: all supported releases
1 parent0499bd2 commit08fdfe7

File tree

1 file changed

+1
-0
lines changed
  • src/backend/storage/smgr

1 file changed

+1
-0
lines changed

‎src/backend/storage/smgr/md.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ mdtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
868868
v=v->mdfd_chain;
869869
Assert(ov!=reln->md_fd[forknum]);/* we never drop the 1st
870870
* segment */
871+
FileClose(ov->mdfd_vfd);
871872
pfree(ov);
872873
}
873874
elseif (priorblocks+ ((BlockNumber)RELSEG_SIZE)>nblocks)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp