Re: How to simulate crashes of PostgreSQL?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Vick Khera <vivek(at)khera(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to simulate crashes of PostgreSQL?
Date: 2009-08-25 18:49:26
Message-ID: 20090825184926.GH12604@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Vick Khera <vivek(at)khera(dot)org> writes:
> > On Tue, Aug 25, 2009 at 1:09 PM, Alvaro
> > Herrera<alvherre(at)commandprompt(dot)com> wrote:
> >> PG is not supposed to crash when it runs out of file descriptors. In
> >> fact there's a whole abstraction layer to ensure this does not happen.
>
> > From my syslog:
> > Aug 21 15:11:13 d01 postgres[12037]: [156-1] PANIC: could not open
> > file "pg_xlog/00000001000013E300000014" (log file 5091, segment 20):
> > Too many open files in system
>
> This is probably coming from walwriter, which might not have very much
> of a cushion of "extra" open files to close.

Note that this is ENFILE, not EMFILE; so if the load is high, it's
possible that the released file descriptor is immediately taken by
another process before BasicFileOpen is able to grab it (assuming
there's any open file to close).

Vivek, do you see this error message before the PANIC?
LOG: out of file descriptors: %m; release and retry

Would it be worth for walwriter to grab a dozen of dummy fd's?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2009-08-25 18:57:41 Re: How to simulate crashes of PostgreSQL?
Previous Message Marcus Engene 2009-08-25 18:28:44 Re: somewhat slow query with subselect