Re: clarify documentation of BGW_NEVER_RESTART ?

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: clarify documentation of BGW_NEVER_RESTART ?
Date: 2018-09-28 11:59:24
Message-ID: CAA4eK1JYVmqXQMqxv1u6GOkrOgXgRB4=WCnBj7yLmdtSDAMbgg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 26, 2018 at 3:17 AM Chapman Flack <chap(at)anastigmatix(dot)net> wrote:
>
> I did not notice until today that there is some ambiguity in
> this paragraph:
>
> bgw_restart_time is the interval, in seconds, that postgres should
> wait before restarting the process, in case it crashes. It can be
> any positive value, or BGW_NEVER_RESTART, indicating not to restart
> the process in case of a crash.
>
> I had been reading "in case _it_ crashes" and "in case of _a_ crash"
> as "in case _the background worker_ crashes", so I assumed with
> BGW_NEVER_RESTART I was saying I don't want my worker restarted if
> _it_ flakes out while PG is otherwise operating normally.
>
> But I was surprised when the unrelated crash of a different, normal
> backend left my background worker killed and never restarted. I had
> always regarded the fatal-error kick-out-all-backends-and-recover
> handling as essentially equivalent to a PG restart, so I had expected
> it to start the bgworker over just as a real restart would.
>
> But sure enough, ResetBackgroundWorkerCrashTimes() gets called in
> that case, and treats every worker with BGW_NEVER_RESTART as gone
> and forgotten. So it seems the "it" in "it crashes" can be "the
> background worker" or "postgres itself" or "any shmem-connected
> backend".
>

I think that kind of wording might suit for BGW_NEVER_RESTART value,
but for any positive value, the current wording appears fine to me.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-09-28 12:19:58 Re: [HACKERS] kqueue
Previous Message Christoph Berg 2018-09-28 11:58:31 Re: pgsql: Build src/port files as a library with -fPIC, and use that in li