Skip site navigation (1) Skip section navigation (2)

Re: more autovacuum fixes

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: more autovacuum fixes
Date: 2007-06-19 20:02:20
Message-ID: 20070619200220.GH21268@alvh.no-ip.org (view raw or flat)
Thread:
Lists: 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)

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2007-06-19 20:24:43
Subject: Re: [HACKERS] 'Waiting on lock'
Previous:From: Alvaro HerreraDate: 2007-06-19 17:58:14
Subject: Re: more autovacuum fixes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group