Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a1ryJ-0003l0-M1 for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Nov 2015 08:32:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a1ryJ-00014O-3g for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Nov 2015 08:32:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a1rxg-0000Nr-JP for pgsql-bugs@postgresql.org; Thu, 26 Nov 2015 08:31:28 +0000 Received: from mail.catalyst.net.nz ([2404:130:0:10::40:0]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1a1rxc-0006n9-DC for pgsql-bugs@postgresql.org; Thu, 26 Nov 2015 08:31:27 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 8346633284 for ; Thu, 26 Nov 2015 21:31:14 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yrLA3kP-MnL6 for ; Thu, 26 Nov 2015 21:31:13 +1300 (NZDT) Received: from [192.168.1.64] (unknown [122.61.216.255]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 6226E33996 for ; Thu, 26 Nov 2015 21:31:13 +1300 (NZDT) To: pgsql-bugs@postgresql.org From: Mark Kirkwood Subject: Recovery conflict message lost in user session for 9.3 Message-ID: <5656C351.1070300@catalyst.net.nz> Date: Thu, 26 Nov 2015 21:31:13 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -5.2 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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