Re: BUG #14231: logical replication wal sender process spins when using error traps in function - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Date
Msg-id CAM3SWZSqBWmJEwu6-aFkN7XkPdybw_nrSfcjNtnJvq8m8-Rcig@mail.gmail.com
Whole thread Raw
In response to Re: BUG #14231: logical replication wal sender process spins when using error traps in function  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: BUG #14231: logical replication wal sender process spins when using error traps in function
List pgsql-bugs
On Wed, Jul 6, 2016 at 2:26 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>> So I think this is primarily an artifact of doing so much retail
>> palloc/pfree in a single memory context.
>
> As I recall, this is the main reason Andres stuck the slab cache in
> reorderbuffer.  Maybe it'd be worthwhile to implement a different
> MemoryContext tailored to this use case, and remove the slab cache
> stuff.

I withdraw my remarks on that commit -- I don't think that's what it is now.

I had luck adding a new child memory context for tuplesort.c in commit
0011c0091e886b874e485a46ff2c94222ffbf550. This allowed tuplesort.c to
blow away the free list via a new call to MemoryContextReset(). This
didn't even remove *any* pfree() operations in the affected codepath,
but was still quite effective.

I'm not sure that that's comparable, but it may be an interesting case
that others are not aware of.

--
Peter Geoghegan

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Next
From: Andres Freund
Date:
Subject: Re: BUG #14150: Attempted to delete invisible tuple