Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V3naB-0007qs-PW for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Jul 2013 13:33:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V3naB-0000qJ-7l for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Jul 2013 13:33:51 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V3na9-0000oy-Jb; Mon, 29 Jul 2013 13:33:49 +0000 Received: from mx4-phx2.redhat.com ([209.132.183.25]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V3na6-0005oZ-5w; Mon, 29 Jul 2013 13:33:48 +0000 Received: from zmail16.collab.prod.int.phx2.redhat.com (zmail16.collab.prod.int.phx2.redhat.com [10.5.83.18]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6TDXi0p004006; Mon, 29 Jul 2013 09:33:44 -0400 Date: Mon, 29 Jul 2013 09:33:44 -0400 (EDT) From: Ondrej Chaloupka To: pgsql-general@postgresql.org, pgsql-bugs@postgresql.org Cc: Pavel Raiskup , Tom Jenkinson Message-ID: <399053975.7952081.1375104824437.JavaMail.root@redhat.com> In-Reply-To: <1603079961.7916219.1375102521553.JavaMail.root@redhat.com> Subject: Incorrect response code after XA recovery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.5.82.12] X-Mailer: Zimbra 8.0.3_GA_5664 (ZimbraWebClient - FF22 (Linux)/8.0.3_GA_5664) Thread-Topic: Incorrect response code after XA recovery Thread-Index: nYDNuioW/DSmt+w364slSAUqkY6GGw== X-Pg-Spam-Score: -5.7 (-----) 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 Hi, I would like to consult with you a problematic response put by PostgreSQL after transaction recovery run by Narayana (JBossTS). I work on tests for Narayana and I hit a issue with PostgreSQL. The db returns incorrect code XAException.XA_HEURHAZ when the TM does recovery after crash of the jboss eap app server. The exception is following: Caused by: org.postgresql.util.PSQLException: ERROR: prepared transaction with identifier "131072_AAAAAAAAAAAAAP//fwAAAd7TXOBR8jj5AAAAKDE=_AAAAAAAAAAAAAP//fwAAAd7TXOBR8jj5AAAALQAAAAAAAAAA" does not exist It's run on PostgreSQL 9.2 but the older versions seem to be affected as well. The problem occurs when TM runs on JTS transactions. The idea of the test: The test enlists two resources to a transaction. There is called prepare on resource of PostgreSQL. The app server crashes before prepare is called on second transaction participant. After restart of the app server TM tries to recover the transaction. As the fail occurs during prepare phase rollback is expected. The OTS specification requires both bottom up and top down recovery to be triggered by the recovering resource. This causes that two rollback calls are done against the DB. DB receives rollback call and does the rollback. Then for the second time it returns the exceptional code. As the DB already rollbacked the transaction and forgot about it the DB returns error that no such transaction exists. But this seems to be against OTS specification. There are some more details in the following bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=988724 Do you have some experience with such behaviour? Can I suppose this being problem of PostgreSQL? Or is there already some bug for this issue in Postgres bugtracking system? Thank you Ondra -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs