Re: shared-memory based stats collector - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: shared-memory based stats collector
Date
Msg-id 20200309183705.GA10363@alvherre.pgsql
Whole thread Raw
In response to Re: shared-memory based stats collector  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: shared-memory based stats collector  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Tom Lane escribió:

In patch 0003,

>          /*
> -         * Was it the archiver?  If so, just try to start a new one; no need
> -         * to force reset of the rest of the system.  (If fail, we'll try
> -         * again in future cycles of the main loop.).  Unless we were waiting
> -         * for it to shut down; don't restart it in that case, and
> -         * PostmasterStateMachine() will advance to the next shutdown step.
> +         * Was it the archiver?  Normal exit can be ignored; we'll start a new
> +         * one at the next iteration of the postmaster's main loop, if
> +         * necessary. Any other exit condition is treated as a crash.
>           */
>          if (pid == PgArchPID)
>          {
>              PgArchPID = 0;
>              if (!EXIT_STATUS_0(exitstatus))
> -                LogChildExit(LOG, _("archiver process"),
> -                             pid, exitstatus);
> -            if (PgArchStartupAllowed())
> -                PgArchPID = pgarch_start();
> +                HandleChildCrash(pid, exitstatus,
> +                                 _("archiver process"));
>              continue;
>          }

I'm worried that we're causing all processes to terminate when an
archiver dies in some ugly way; but in the current coding, it's pretty
harmless and we'd just start a new one.  I think this needs to be
reconsidered.  As far as I know, pgarchiver remains unconnected to
shared memory so a crash-restart cycle is not necessary.  We should
continue to just log the error message and move on.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Improve search for missing parent downlinks in amcheck
Next
From: Andres Freund
Date:
Subject: Re: shared-memory based stats collector