Re: [GENERAL] Incorrect response code after XA recovery

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Tom Jenkinson <tom(dot)jenkinson(at)redhat(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ondrej Chaloupka <ochaloup(at)redhat(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org, Pavel Raiskup <praiskup(at)redhat(dot)com>
Subject: Re: [GENERAL] Incorrect response code after XA recovery
Date: 2013-07-29 17:52:31
Message-ID: E73A9E49-4AAA-4E14-9C2B-2F45BC8B03C1@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-jdbc

On Jul 29, 2013, at 16:57, Tom Jenkinson <tom(dot)jenkinson(at)redhat(dot)com> wrote:

> Hi Tom,
>
> On Mon 29 Jul 2013 15:46:12 BST, Tom Lane wrote:
>> Tom Jenkinson <tom(dot)jenkinson(at)redhat(dot)com> 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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jaime Casanova 2013-07-29 19:17:38 Re: PROBABLE BUG
Previous Message Jeff Janes 2013-07-29 17:16:41 Re: BUG #8154: pg_dump throws error beacause of field called "new".

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2013-07-29 18:25:15 Re: maintenance_work_mem and CREATE INDEX time
Previous Message Tim Spencer 2013-07-29 16:37:59 Re: how _not_ to log?

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2013-07-30 08:26:23 Re: Website Redo Kick Off
Previous Message Dave Cramer 2013-07-29 15:57:27 Re: Facing issue with driver postgresql-9.2-1003.jdbc4 on PostgreSQL 9.2.4