Re: ERROR during end-of-xact/FATAL

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR during end-of-xact/FATAL
Date: 2013-11-08 14:12:17
Message-ID: CA+TgmoYcU70gswbSaLtRhpbM5Di5pU1Uwp5aBfjAauEDu2ASpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 6, 2013 at 9:40 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> Noah Misch wrote:
>> Incomplete list:
>>
>> - If smgrDoPendingDeletes() finds files to delete, mdunlink() and its callee
>> relpathbackend() call palloc(); this is true in all supported branches. In
>> 9.3, due to commit 279628a0, smgrDoPendingDeletes() itself calls palloc().
>> (In fact, it does so even when the pending list is empty -- this is the only
>> palloc() during a trivial transaction commit.) palloc() failure there
>> yields a PANIC during commit.
>
> I think we should fix this routine to avoid the palloc when not necessary.
> That initial palloc is pointless.
>
> Also, there have been previous discussions about having relpathbackend
> not use palloc at all. That was only because we wanted to use it in
> pg_xlogdump which didn't have palloc support at the time, so it's no
> longer as pressing; but perhaps it's still worthy of consideration.

+1, but I'd like it better if we could find a way of avoiding the
palloc in all cases. Panicking because we run out of memory at the
wrong time isn't really very nice. Maybe the information needs to be
maintained in the format in which it ultimately needs to be returned,
so that we needn't rejigger it in the middle of a critical section.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Albe Laurenz 2013-11-08 14:20:02 Re: FDW: possible resjunk columns in AddForeignUpdateTargets
Previous Message Euler Taveira 2013-11-08 14:06:23 Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]