From: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
To: pgsql-bugs@postgresql.org
Subject: Recovery conflict message lost in user session for 9.3
Date: Thu, 26 Nov 2015 21:31:13 +1300
Message-ID: <5656C351.1070300@catalyst.net.nz> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
I noticed this while teaching a Postgres course.
I'm using 9.3.10 (but suspect all/most prev 9.3.x the same):
Suppose I have a primary/standby streaming replication setup.
Session 1 (standby):
bench=# BEGIN;
BEGIN
bench=# DECLARE hcur CURSOR FOR select * FROM pgbench_history;
DECLARE CURSOR
bench=# fetch hcur;
tid | bid | aid | delta | mtime | filler
-----+-----+--------+-------+----------------------------+--------
90 | 98 | 499159 | 4384 | 2015-11-26 20:28:19.502997 |
(1 row)
Session 2 (primary):
bench=# UPDATE pgbench_history SET filler = 'filled';
UPDATE 3159
Session 1 (standby - wait > 30s):
bench=# fetch hcur;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
Now in the standby log I see:
FATAL: terminating connection due to conflict with recovery
DETAIL: User query might have needed to see row versions that must be
removed.
HINT: In a moment you should be able to reconnect to the database and
repeat your command.
However this is not transmitted to the standby user's session, so
leaving an unhelpful message about why the session got killed. Testing
with 9.1, 9.4, 9.5, 9.6 (noted not tested 9.2) seems to show that these
versions get the more descriptive message to the standby user's session
ok. Might be good to have 9.3 behave the same.
regards
Mark
--
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: mark.kirkwood@catalyst.net.nz
Subject: Re: Recovery conflict message lost in user session for 9.3
In-Reply-To: <5656C351.1070300@catalyst.net.nz>
References: <5656C351.1070300@catalyst.net.nz>
* 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