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

From Alvaro Herrera
Subject Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Date
Msg-id 20160706212600.GA649263@alvherre.pgsql
Whole thread Raw
In response to Re: BUG #14231: logical replication wal sender process spins when using error traps in function  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Re: BUG #14231: logical replication wal sender process spins when using error traps in function
List pgsql-bugs
Andrew Gierth wrote:

> A quick scan of the code suggests that the worst case is when blocks are
> being freed in FIFO order, which seems quite plausible in this case, and
> the performance is potentially O(N^2).
>
> 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.

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

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Next
From: andres@anarazel.de (Andres Freund)
Date:
Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function