Re: ANALYZE crashes randomly - Mailing list pgsql-admin

From Tom Lane
Subject Re: ANALYZE crashes randomly
Date
Msg-id 27320.1077285812@sss.pgh.pa.us
Whole thread Raw
In response to Re: ANALYZE crashes randomly  (Olivier Hubaut <olivier@scmbb.ulb.ac.be>)
Responses Re: ANALYZE crashes randomly  (Olivier Hubaut <olivier@scmbb.ulb.ac.be>)
List pgsql-admin
Olivier Hubaut <olivier@scmbb.ulb.ac.be> writes:
>>> PANIC:  could not open transaction-commit log directory
>>> (/usr/local/pgsql/annot/pg_clog): Too many open files

> But it's amazing to me that i had to reduce it so much as the postmaster
> is almost the only application running on this server.

Oh, wait, I bet you are running into the per-process open file limit not
the kernel limit.  The per-process limit is usually pretty low on
Darwin, and checking the code I see

    xldir = opendir(XLogDir);
    if (xldir == NULL)
        ereport(PANIC,
                (errcode_for_file_access(),
            errmsg("could not open transaction log directory \"%s\": %m",
                   XLogDir)));

That is, we don't have a fallback path to recover when the error is
ENFILE or EMFILE.  Looks to me like all the opendir() calls in the
backend ought to be handled by fd.c with code to release other open
files at need.

In the meantime, though, it seems fishy that Postgres wouldn't have
detected and allowed for the per-process file limit.  Which version of
OS X did you say you were using?

            regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: ANALYZE crashes randomly
Next
From: Olivier Hubaut
Date:
Subject: Re: ANALYZE crashes randomly