diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-06-02 03:58:34 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-06-02 03:58:34 +0000 |
| commit | b659ab07a2b4067b7210c8f2f6daa947817a2bfe (patch) | |
| tree | 5320e447110fc16a1bfd087a6a3dae07b702a7bb /src/backend/storage/smgr | |
| parent | 60b941f9a400e37a463144cde2ec8a1c2e625d64 (diff) | |
| download | postgresql-b659ab07a2b4067b7210c8f2f6daa947817a2bfe.tar.gz | |
Create an fd.c entry point that is just like plain open(2) except that
it will close VFDs if necessary to surmount ENFILE or EMFILE failures.
Make use of this in md.c, xlog.c, and user.c routines that were
formerly vulnerable to these failures. In particular, this should
handle failures of mdblindwrt() that have been observed under heavy
load conditions. (By golly, every other process on the system may
crash after Postgres eats up all the kernel FDs, but Postgres will
keep going!)
Diffstat (limited to 'src/backend/storage/smgr')
| -rw-r--r-- | src/backend/storage/smgr/md.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c index e4fd3120d2..4c1cac5472 100644 --- a/src/backend/storage/smgr/md.c +++ b/src/backend/storage/smgr/md.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.68 2000/05/25 23:30:20 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.69 2000/06/02 03:58:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1129,10 +1129,11 @@ _mdfd_blind_getseg(char *dbname, char *relname, Oid dbid, Oid relid, } #endif + /* call fd.c to allow other FDs to be closed if needed */ #ifndef __CYGWIN32__ - fd = open(path, O_RDWR, 0600); + fd = BasicOpenFile(path, O_RDWR, 0600); #else - fd = open(path, O_RDWR | O_BINARY, 0600); + fd = BasicOpenFile(path, O_RDWR | O_BINARY, 0600); #endif if (fd < 0) |
