summaryrefslogtreecommitdiff
path: root/src/include/storage/smgr.h
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2022-05-07 16:19:42 +1200
committerThomas Munro <tmunro@postgresql.org>2022-05-07 16:32:10 +1200
commitb74e94dc27fdbb13954f230b1d1298430afa6c0c (patch)
treee67f872e3a7ce3cd62480978831c541529d36e45 /src/include/storage/smgr.h
parent701d918a426b394620ce4d046533f77262c70829 (diff)
Rethink PROCSIGNAL_BARRIER_SMGRRELEASE.
With sufficiently bad luck, it was possible for IssuePendingWritebacks() to reopen a file after we'd processed PROCSIGNAL_BARRIER_SMGRRELEASE and before the file was unlinked by some other backend. That left a small hole in commit 4eb21763's plan to fix all spurious errors from DROP TABLESPACE and similar on Windows. Fix by closing md.c's segments, instead of just closing fd.c's descriptors, and then teaching smgrwriteback() not to open files that aren't already open. Reported-by: Andres Freund <andres@anarazel.de> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://postgr.es/m/20220209220004.kb3dgtn2x2k2gtdm%40alap3.anarazel.de
Diffstat (limited to 'src/include/storage/smgr.h')
-rw-r--r--src/include/storage/smgr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index 8e3ef92cda1..6b63c60fbd9 100644
--- a/src/include/storage/smgr.h
+++ b/src/include/storage/smgr.h
@@ -85,6 +85,8 @@ extern void smgrclearowner(SMgrRelation *owner, SMgrRelation reln);
extern void smgrclose(SMgrRelation reln);
extern void smgrcloseall(void);
extern void smgrclosenode(RelFileNodeBackend rnode);
+extern void smgrrelease(SMgrRelation reln);
+extern void smgrreleaseall(void);
extern void smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo);
extern void smgrdosyncall(SMgrRelation *rels, int nrels);
extern void smgrdounlinkall(SMgrRelation *rels, int nrels, bool isRedo);