Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V4B4n-0001TN-BP for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Jul 2013 14:39:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V4B4m-0003sO-Io for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Jul 2013 14:39:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V49vx-0003PO-AW; Tue, 30 Jul 2013 13:25:49 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V49vp-00077Y-3h; Tue, 30 Jul 2013 13:25:48 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6UDPbEE020971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Jul 2013 09:25:37 -0400 Received: from [10.36.112.47] (ovpn-112-47.ams2.redhat.com [10.36.112.47]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6UDPVRP002139; Tue, 30 Jul 2013 09:25:32 -0400 Message-ID: <51F7BECB.5060508@redhat.com> Date: Tue, 30 Jul 2013 14:25:31 +0100 From: Tom Jenkinson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Alban Hertroys CC: Tom Lane , Ondrej Chaloupka , pgsql-general@postgresql.org, pgsql-bugs@postgresql.org, Pavel Raiskup Subject: Re: [GENERAL] Incorrect response code after XA recovery References: <399053975.7952081.1375104824437.JavaMail.root@redhat.com> <25825.1375105824@sss.pgh.pa.us> <51F679F6.4080504@redhat.com> <26246.1375109172@sss.pgh.pa.us> <51F682DF.9020806@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Pg-Spam-Score: -8.4 (--------) 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 Alban, I stripped down the code to a raw XA example using the latest postgres driver available in maven central. It demonstrates that regardless of what the codebase might suggest, it is certainly the case that postgres is returning XAER_RMERR in the scenario where the resource manager no longer knows about the Xid. The code is available here: https://github.com/tomjenkinson/xa-recovery/commit/944d45e86a91eacb9489843acfbf6a80f1b4b820 I hope that this helps, Tom On Mon 29 Jul 2013 18:52:31 BST, Alban Hertroys wrote: > On Jul 29, 2013, at 16:57, Tom Jenkinson wrote: > >> Hi Tom, >> >> On Mon 29 Jul 2013 15:46:12 BST, Tom Lane wrote: >>> Tom Jenkinson writes: >>>> A little bit of information in the linked bugzilla report is that the >>>> exception being returned has an XA error code of XAER_RMERR "An error >>>> occurred in rolling back the transaction branch. The resource manager is >>>> free to forget about the branch when returning this error so long as all >>>> accessing threads of control have been notified of the branch’s state." >>> >>>> That does not sound right to me, wouldn't XAER_NOTA "The specified XID >>>> is not known by the resource manager" be more accurate? >>> >>> No idea, but in any case that's outside Postgres' purview. It's barely >>> possible that the Postgres JDBC driver has something to do with that, >>> but it sounds more like the XA manager's turf. >> >> I am not sure what you mean here as I don't know the structure of how the PostGres project is packaged, all I know is that the PostGres JDBC driver component appears to be returning an XAException with the message "Error rolling back prepared transaction" and an errorCode of XAException.XAER_RMERR rather than XAER_NOTA. > > > Looking at the error codes, it appears that it isn't even the Postgres JDBC driver returning that error, but the XA manager you're using, which is not a part of Postgres (nor is the JDBC driver, for that matter - that's a separate project). > > The errors you're quoting are from the XA manager and are about XA manager stuff. For all we know, the actual error appears to be occuring in the XA manager and not in Postgres. It's possible that the XA manager error is a result of an error that Postgres returned, but since the XA manager prints its own error message and not the original one, you'll need to uncover those error messages before we can help you with them. > > For all we know at this point, the error is with your XA manager, not with Postgres. > > If you want to be sure, grep the source of the JDBC driver for those error codes; I doubt you'll find them in there. > Google was kind enough to point me here: http://jdbc.postgresql.org/development/git.html > > Alban Hertroys > -- > If you can't see the forest for the trees, > cut the trees and you'll find there is no forest. > -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs