From: blake@rcmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14231: logical replication wal sender process spins when using error traps in function
Date: Wed, 06 Jul 2016 18:55:02 +0000
Message-ID: <20160706185502.1426.28143@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14231
Logged by: Michael Day
Email address: blake@rcmail.com
PostgreSQL version: 9.4.6
Operating system: FreeBSD 10.1-RELEASE
Description:
The following function can be used to reproduce an issue with logical
replication (version 9.4.6).
Connect a logical client with test_decoding plugin and run the code below.
It will cause the replication process to spin, using 100% CPU for some long
period of time.
Recovery time seems to exponentially increase depending on the number of
times the function is called.
It is impossible to prematurely stop the process without restarting the
server (it does not take notice of a disconnect).
CREATE TABLE IF NOT EXISTS test1 (id serial not null, value text);
CREATE OR REPLACE FUNCTION test1()
RETURNS void AS $$
BEGIN
BEGIN
INSERT INTO test1 (value) values (random()::text);
EXCEPTION WHEN unique_violation THEN
-- JUST having this exception handling block causes it to fail
END;
END;
$$ LANGUAGE plpgsql;
explain analyze SELECT test1() FROM generate_series(1, 50000);
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: blake@rcmail.com
Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function
In-Reply-To: <20160706185502.1426.28143@wrigleys.postgresql.org>
References: <20160706185502.1426.28143@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox