Re: Unintended restart after recovery error

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unintended restart after recovery error
Date: 2014-11-12 16:07:25
Message-ID: CAHGQGwHixg9SPS9qqbVQCeWQG=zY5Y0MzBa57KuNb_8aL=Mvuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 12, 2014 at 6:52 PM, Antonin Houska <ah(at)cybertec(dot)at> wrote:
> While looking at postmaster.c:reaper(), one problematic case occurred to me.
>
>
> 1. Startup process signals PMSIGNAL_RECOVERY_STARTED.
>
> 2. Checkpointer process is forked and immediately dies.
>
> 3. reaper() catches this failure, calls HandleChildCrash() and thus sets
> FatalError to true.
>
> 4. Startup process exits with non-zero status code too - either due to SIGQUIT
> received from HandleChildCrash or due to some other failure of the startup
> process itself. However, FatalError is already set, because of the previous
> crash of the checkpointer. Thus reaper() does not set RecoveryError.
>
> 5. As RecoverError failed to be set to true, postmaster will try to restart
> the cluster, although it apparently should not.

Why shouldn't postmaster restart the cluster in that case?

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-11-12 16:15:26 Re: pg_background (and more parallelism infrastructure patches)
Previous Message Andres Freund 2014-11-12 15:59:49 Re: what does this mean: "running xacts with xcnt == 0"