Re: [bug fix] Produce a crash dump before main() on Windows

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] Produce a crash dump before main() on Windows
Date: 2019-11-10 09:54:51
Message-ID: CAMsr+YFaYum9jAbXyWeTA1aEQvZHeXNVy2CgcDPr_Wv_F39k9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 18 Jul 2018 at 12:10, Kyotaro HORIGUCHI <
horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:

> At Wed, 18 Jul 2018 11:12:06 +0800, Craig Ringer <craig(at)2ndquadrant(dot)com>
> wrote in <CAMsr+YHv0KfWhA+Z=UVydpvLQ-QyLaidBqpHxQ=
> YqTPiDGG6dg(at)mail(dot)gmail(dot)com>
> > On 26 February 2018 at 12:06, Tsunakawa, Takayuki <
> > tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
> >
> > > From: Craig Ringer [mailto:craig(at)2ndquadrant(dot)com]
> > > > The patch proposed here means that early crashes will invoke WER. If
> > > we're
> > > > going to allow WER we should probably just do so unconditionally.
> > > >
> > > > I'd be in favour of leaving WER on when we find out we're in a
> > > noninteractive
> > > > service too, but that'd be a separate patch for pg11+ only.
> > >
> > > As for PG11+, I agree that we want to always leave WER on. That is,
> call
> > > SetErrorMode(SEM_FAILCRITICALERRORS) but not specify
> > > SEM_NOGPFAULTERRORBOX. The problem with the current specification of
> > > PostgreSQL is that the user can only get crash dumps in a fixed folder
> > > $PGDATA\crashdumps. That location is bad because the crash dumps will
> be
> > > backed up together with the database cluster without the user noticing
> it.
> > > What's worse, the crash dumps are large. With WER, the user can
> control
> > > the location and size of crash dumps.
> > >
> >
> > Yeah, that's quite old and dates back to when Windows didn't offer much
> if
> > any control over WER in services.
>
> Yeah. If we want to take a crash dump, we cannot have
> auto-restart. Since it is inevitable what we can do for this
> would be adding a new knob for that, which cannot be turned on
> together with restart_after_crash...?

Why?

Mind you, I don't much care about restart_after_crash, I think it's
thoroughly obsolete. Windows has been capable of restarting failed services
forever, and systemd does so too. There's little reason to have postgres
try to do its own self-recovery now, and I prefer to disable it so the
postmaster can cleanly exit and get a fresh new launch.

--
Craig Ringer http://www.2ndQuadrant.com/
2ndQuadrant - PostgreSQL Solutions for the Enterprise

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2019-11-10 10:03:08 Re: [bug fix] Produce a crash dump before main() on Windows
Previous Message Craig Ringer 2019-11-10 09:51:17 Re: Allow cluster_name in log_line_prefix