Re: more autovacuum fixes - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: more autovacuum fixes
Date
Msg-id 20070619200220.GH21268@alvh.no-ip.org
Whole thread Raw
In response to more autovacuum fixes  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: more autovacuum fixes  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-patches
Alvaro Herrera wrote:

> One problem with the patch is this (new code):
>
>     bn = (Backend *) malloc(sizeof(Backend));
> !   if (bn)
>     {
> !       bn->pid = StartAutoVacWorker();
> !       bn->is_autovacuum = true;
> !       /* we don't need a cancel key */
>
> !       if (bn->pid > 0)
> !       {
> !           /* FIXME -- unchecked memory allocation here */
> !           DLAddHead(BackendList, DLNewElem(bn));
>
>
> If the palloc() inside DLNewElem fails, we will fail to report a "fork
> failure" to the launcher.  I am not sure how serious this is.

Turns out that this problem is not serious at all, because if that
palloc() fails, the whole postmaster will exit with a FATAL out of
memory message.

The problems in the worker code after fork are still an issue though.

--
Alvaro Herrera                 http://www.amazon.com/gp/registry/DXLWNGRJD34J
"MySQL is a toy compared to PostgreSQL."             (Randal L. Schwartz)
      (http://archives.postgresql.org/pgsql-general/2005-07/msg00517.php)

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] 'Waiting on lock'
Next
From: "Simon Riggs"
Date:
Subject: Re: [HACKERS] 'Waiting on lock'