You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<
8000
script type="application/json" data-target="react-app.embeddedData">{"payload":{"commit":{"oid":"6a8ffe812d194ba6f4f26791b6388a4837d17d6c","url":"/postgres/postgres/commit/6a8ffe812d194ba6f4f26791b6388a4837d17d6c","authoredDate":"2024-01-31T11:40:29.000+02:00","committedDate":"2024-01-31T11:40:29.000+02:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eRemove some obsolete smgrcloseall() calls.\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"Before the advent of PROCSIGNAL_BARRIER_SMGRRELEASE, we didn't have a\ncomprehensive way to deal with Windows file handles that get in the way\nof unlinking directories. We had smgrcloseall() calls in a few places\nto try to mitigate.\n\nIt's still a good idea for bgwriter and checkpointer to do that once per\ncheckpoint so they don't accumulate unbounded SMgrRelation objects, but\nthere is no longer any reason to close them at other random places such\nas the error path, and the explanation as given in the comments is now\nobsolete.\n\nAuthor: Thomas Munro\nReviewed-by: Heikki Linnakangas, Robert Haas\nDiscussion: \u003ca href=\"https://www.postgresql.org/message-id/CA%2BhUKGJ8NTvqLHz6dqbQnt2c8XCki4r2QvXjBQcXpVwxTY_pvA@mail.gmail.com\" rel=\"nofollow\"\u003ehttps://www.postgresql.org/message-id/CA%2BhUKGJ8NTvqLHz6dqbQnt2c8XCki4r2QvXjBQcXpVwxTY_pvA@mail.gmail.com\u003c/a\u003e","authors":[{"login":"hlinnaka","displayName":"Heikki Linnakangas","avatarUrl":"https://avatars.githubusercontent.com/u/191602?v=4","path":"/hlinnaka","isGitHub":false}],"committerAttribution":false,"committer":{"login":"hlinnaka","displayName":"Heikki Linnakangas","avatarUrl":"https://avatars.githubusercontent.com/u/191602?v=4","path":"/hlinnaka","isGitHub":false},"parents":["0fda3921380798897b6faca5e4fdcdc22f950f12"],"globalRelayId":"C_kwDOAA4m0toAKDZhOGZmZTgxMmQxOTRiYTZmNGYyNjc5MWI2Mzg4YTQ4MzdkMTdkNmM","sha1":"0fda3921380798897b6faca5e4fdcdc22f950f12","sha2":"6a8ffe812d194ba6f4f26791b6388a4837d17d6c"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":196,"text":"@@ -197,13 +197,6 @@ BackgroundWriterMain(void)","html":"@@ -197,13 +197,6 @@ BackgroundWriterMain(void)","displayNoNewLineWarning":false,"position":0,"left":196,"right":196},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":197,"text":" \t\t */","html":" \u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":197,"right":197},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":198,"text":" \t\tpg_usleep(1000000L);","html":" \t\t\u003cspan class=pl-en\u003epg_usleep\u003c/span\u003e(\u003cspan class=pl-c1\u003e1000000L\u003c/span\u003e);","displayNoNewLineWarning":false,"position":2,"left":198,"right":198},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":199,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":3,"left":199,"right":199},{"stylingDirective":null,"type":"DELETION","blobLineNumber":200,"text":"-\t\t/*","html":"-\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":200,"right":199},{"stylingDirective":null,"type":"DELETION","blobLineNumber":201,"text":"-\t\t * Close all open files after any error. This is helpful on Windows,","html":"-\u003cspan class=pl-c\u003e\t\t * Close all open files after any error. This is helpful on Windows,\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":201,"right":199},{"stylingDirective":null,"type":"DELETION","blobLineNumber":202,"text":"-\t\t * where holding deleted files open causes various strange errors.","html":"-\u003cspan class=pl-c\u003e\t\t * where holding deleted files open causes various strange errors.\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":202,"right":199},{"stylingDirective":null,"type":"DELETION","blobLineNumber":203,"text":"-\t\t * It's not clear we need it elsewhere, but shouldn't hurt.","html":"-\u003cspan class=pl-c\u003e\t\t * It\u0026#39;s not clear we need it elsewhere, but shouldn\u0026#39;t hurt.\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":203,"right":199},{"stylingDirective":null,"type":"DELETION","blobLineNumber":204,"text":"-\t\t */","html":"-\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":204,"right":199},{"stylingDirective":null,"type":"DELETION","blobLineNumber":205,"text":"-\t\tsmgrcloseall();","html":"-\t\t\u003cspan class=pl-en\u003esmgrcloseall\u003c/span\u003e();","displayNoNewLineWarning":false,"position":9,"left":205,"right":199},{"stylingDirective":null,"type":"DELETION","blobLineNumber":206,"text":"-","html":"-","displayNoNewLineWarning":false,"position":10,"left":206,"right":199},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":200,"text":" \t\t/* Report wait end here, when there is no further possibility of wait */","html":" \t\t\u003cspan class=pl-c\u003e/* Report wait end here, when there is no further possibility of wait */\u003c/span\u003e","displayNoNewLineWarning":false,"position":11,"left":207,"right":200},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":201,"text":" \t\tpgstat_report_wait_end();","html":" \t\t\u003cspan class=pl-en\u003epgstat_report_wait_end\u003c/span\u003e();","displayNoNewLineWarning":false,"position":12,"left":208,"right":201},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":202,"text":" \t}","html":" \t}","displayNoNewLineWarning":false,"position":13,"left":209,"right":202}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":339,"linesChanged":7,"newTreeEntry":{"lineCount":339,"path":"src/backend/postmaster/bgwriter.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/postmaster/bgwriter.c","mode":100644},"linesAdded":0,"linesDeleted":7,"path":"src/backend/postmaster/bgwriter.c","pathDigest":"3cef80c6226c9e86fe593e87164e2b6e58a87845fb004192ebb407a59a586d4f","status":"MODIFIED","truncatedReason":null,"oldOid":"0fda3921380798897b6faca5e4fdcdc22f950f12","newOid":"6a8ffe812d194ba6f4f26791b6388a4837d17d6c","copilotChatReference":null,"deletedSha":"0fda3921380798897b6faca5e4fdcdc22f950f12","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":300,"text":"@@ -301,13 +301,6 @@ CheckpointerMain(void)","html":"@@ -301,13 +301,6 @@ CheckpointerMain(void)","displayNoNewLineWarning":false,"position":0,"left":300,"right":300},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":301,"text":" \t\t * fast as we can.","html":" \u003cspan class=pl-c\u003e\t\t * fast as we can.\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":301,"right":301},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":302,"text":" \t\t */","html":" \u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":302,"right":302},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":303,"text":" \t\tpg_usleep(1000000L);","html":" \t\t\u003cspan class=pl-en\u003epg_usleep\u003c/span\u003e(\u003cspan class=pl-c1\u003e1000000L\u003c/span\u003e);","displayNoNewLineWarning":false,"position":3,"left":303,"right":303},{"stylingDirective":null,"type":"DELETION","blobLineNumber":304,"text":"-","html":"-","displayNoNewLineWarning":false,"position":4,"left":304,"right":303},{"stylingDirective":null,"type":"DELETION","blobLineNumber":305,"text":"-\t\t/*","html":"-\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":305,"right":303},{"stylingDirective":null,"type":"DELETION","blobLineNumber":306,"text":"-\t\t * Close all open files after any error. This is helpful on Windows,","html":"-\u003cspan class=pl-c\u003e\t\t * Close all open files after any error. This is helpful on Windows,\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":306,"right":303},{"stylingDirective":null,"type":"DELETION","blobLineNumber":307,"text":"-\t\t * where holding deleted files open causes various strange errors.","html":"-\u003cspan class=pl-c\u003e\t\t * where holding deleted files open causes various strange errors.\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":307,"right":303},{"stylingDirective":null,"type":"DELETION","blobLineNumber":308,"text":"-\t\t * It's not clear we need it elsewhere, but shouldn't hurt.","html":"-\u003cspan class=pl-c\u003e\t\t * It\u0026#39;s not clear we need it elsewhere, but shouldn\u0026#39;t hurt.\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":308,"right":303},{"stylingDirective":null,"type":"DELETION","blobLineNumber":309,"text":"-\t\t */","html":"-\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":9,"left":309,"right":303},{"stylingDirective":null,"type":"DELETION","blobLineNumber":310,"text":"-\t\tsmgrcloseall();","html":"-\t\t\u003cspan class=pl-en\u003esmgrcloseall\u003c/span\u003e();","displayNoNewLineWarning":false,"position":10,"left":310,"right":303},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":304,"text":" \t}","html":" \t}","displayNoNewLineWarning":false,"position":11,"left":311,"right":304},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":305,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":12,"left":312,"right":305},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":306,"text":" \t/* We can now handle ereport(ERROR) */","html":" \t\u003cspan class=pl-c\u003e/* We can now handle ereport(ERROR) */\u003c/span\u003e","displayNoNewLineWarning":false,"position":13,"left":313,"right":306}],"diffNumber":1,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":1341,"linesChanged":7,"newTreeEntry":{"lineCount":1341,"path":"src/backend/postmaster/checkpointer.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/postmaster/checkpointer.c","mode":100644},"linesAdded":0,"linesDeleted":7,"path":"src/backend/postmaster/checkpointer.c","pathDigest":"1c9387d123b8701ae8293d53b91b2d49110fc637bff3e1c925f3b41857b607d2","status":"MODIFIED","truncatedReason":null,"oldOid":"0fda3921380798897b6faca5e4fdcdc22f950f12","newOid":"6a8ffe812d194ba6f4f26791b6388a4837d17d6c","copilotChatReference":null,"deletedSha":"0fda3921380798897b6faca5e4fdcdc22f950f12","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null},{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":185,"text":"@@ -186,13 +186,6 @@ WalWriterMain(void)","html":"@@ -186,13 +186,6 @@ WalWriterMain(void)","displayNoNewLineWarning":false,"position":0,"left":185,"right":185},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":186,"text":" \t\t * fast as we can.","html":" \u003cspan class=pl-c\u003e\t\t * fast as we can.\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":186,"right":186},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":187,"text":" \t\t */","html":" \u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":2,"left":187,"right":187},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":188,"text":" \t\tpg_usleep(1000000L);","html":" \t\t\u003cspan class=pl-en\u003epg_usleep\u003c/span\u003e(\u003cspan class=pl-c1\u003e1000000L\u003c/span\u003e);","displayNoNewLineWarning":false,"position":3,"left":188,"right":188},{"stylingDirective":null,"type":"DELETION","blobLineNumber":189,"text":"-","html":"-","displayNoNewLineWarning":false,"position":4,"left":189,"right":188},{"stylingDirective":null,"type":"DELETION","blobLineNumber":190,"text":"-\t\t/*","html":"-\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":190,"right":188},{"stylingDirective":null,"type":"DELETION","blobLineNumber":191,"text":"-\t\t * Close all open files after any error. This is helpful on Windows,","html":"-\u003cspan class=pl-c\u003e\t\t * Close all open files after any error. This is helpful on Windows,\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":191,"right":188},{"stylingDirective":null,"type":"DELETION","blobLineNumber":192,"text":"-\t\t * where holding deleted files open causes various strange errors.","html":"-\u003cspan class=pl-c\u003e\t\t * where holding deleted files open causes various strange errors.\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":192,"right":188},{"stylingDirective":null,"type":"DELETION","blobLineNumber":193,"text":"-\t\t * It's not clear we need it elsewhere, but shouldn't hurt.","html":"-\u003cspan class=pl-c\u003e\t\t * It\u0026#39;s not clear we need it elsewhere, but shouldn\u0026#39;t hurt.\u003c/span\u003e","displayNoNewLineWarning":false,"position":8,"left":193,"right":188},{"stylingDirective":null,"type":"DELETION","blobLineNumber":194,"text":"-\t\t */","html":"-\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":9,"left":194,"right":188},{"stylingDirective":null,"type":"DELETION","blobLineNumber":195,"text":"-\t\tsmgrcloseall();","html":"-\t\t\u003cspan class=pl-en\u003esmgrcloseall\u003c/span\u003e();","displayNoNewLineWarning":false,"position":10,"left":195,"right":188},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":189,"text":" \t}","html":" \t}","displayNoNewLineWarning":false,"position":11,"left":196,"right":189},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":190,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":12,"left":197,"right":190},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":191,"text":" \t/* We can now handle ereport(ERROR) */","html":" \t\u003cspan class=pl-c\u003e/* We can now handle ereport(ERROR) */\u003c/span\u003e","displayNoNewLineWarning":false,"position":13,"left":198,"right":191}],"diffNumber":2,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":267,"linesChanged":7,"newTreeEntry":{"lineCount":267,"path":"src/backend/postmaster/walwriter.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/postmaster/walwriter.c","mode":100644},"linesAdded":0,"linesDeleted":7,"path":"src/backend/postmaster/walwriter.c","pathDigest":"6711aa6ebdb2ad451b9ced9781f2079a9ff34684e9f98e8cffe1825ace053ce0","status":"MODIFIED","truncatedReason":null,"oldOid":"0fda3921380798897b6faca5e4fdcdc22f950f12","newOid":"6a8ffe812d194ba6f4f26791b6388a4837d17d6c","copilotChatReference":null,"deletedSha":"0fda3921380798897b6faca5e4fdcdc22f950f12","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/6a8ffe812d194ba6f4f26791b6388a4837d17d6c","fileTreeExpanded":true,"headerInfo":{"additions":0,"deletions":21,"filesChanged":3,"filesChangedString":"3"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":3,"truncated":false,"byteCount":1192,"lineShownCount":42},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"imPcHRLFdmnqKkBt2cpYoxZwdOyYIwHczjp0fL5S-e1goom24s1dTmkmdvqoShqGC4JPGKr64tW6kFBsTJFvpA"},"/users/diffview?diff=unified":{"post":"WzaCYFVns-Ab3om5ta6OFsNKjKDvDvw-E-pJAT4LyZSx99fLpW-Yx5jSvy7ELswz3ri3VN3XHzdnQG0RzMhf3Q"},"/notifications/thread":{"post":"cCY4360E9W0F_U4PDxcYx4BeY8SxFYcfZOARzBAwNXCsfO6M1faiahFtbaGUJaOEw1D5i_H_6SYXTnKR-jSU5g"}}},"title":"Remove some obsolete smgrcloseall() calls. · postgres/postgres@6a8ffe8","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-f6b2312e7da9.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}
Before the advent of PROCSIGNAL_BARRIER_SMGRRELEASE, we didn't have a
comprehensive way to deal with Windows file handles that get in the way
of unlinking directories. We had smgrcloseall() calls in a few places
to try to mitigate.
It's still a good idea for bgwriter and checkpointer to do that once per
checkpoint so they don't accumulate unbounded SMgrRelation objects, but
there is no longer any reason to close them at other random places such
as the error path, and the explanation as given in the comments is now
obsolete.
Author: Thomas Munro
Reviewed-by: Heikki Linnakangas, Robert Haas
Discussion: https://www.postgresql.org/message-id/CA%2BhUKGJ8NTvqLHz6dqbQnt2c8XCki4r2QvXjBQcXpVwxTY_pvA@mail.gmail.com
0 commit comments