Incorrect response code after XA recovery

From: Ondrej Chaloupka <ochaloup(at)redhat(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org
Cc: Pavel Raiskup <praiskup(at)redhat(dot)com>, Tom Jenkinson <tom(dot)jenkinson(at)redhat(dot)com>
Subject: Incorrect response code after XA recovery
Date: 2013-07-29 13:33:44
Message-ID: 399053975.7952081.1375104824437.JavaMail.root@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-jdbc

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-07-29 13:50:24 Re: [BUGS] Incorrect response code after XA recovery
Previous Message matty 2013-07-29 09:11:55 PROBABLE BUG

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Tipton 2013-07-29 13:42:24 Re: Event trigger information accessibility on plpgsql
Previous Message Ingmar Brouns 2013-07-29 13:12:37 Re: to_char with locale decimal separator

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2013-07-29 13:37:36 Re: Facing issue with driver postgresql-9.2-1003.jdbc4 on PostgreSQL 9.2.4
Previous Message Nishant Singh 2013-07-29 13:33:05 Re: Facing issue with driver postgresql-9.2-1003.jdbc4 on PostgreSQL 9.2.4