Incorrect return code for error on call of commit during 2PC - Mailing list pgsql-bugs

From Ondrej Chaloupka
Subject Incorrect return code for error on call of commit during 2PC
Date
Msg-id 1259946913.22869617.1418038388941.JavaMail.zimbra@redhat.com
Whole thread Raw
Responses Re: Incorrect return code for error on call of commit during 2PC
List pgsql-bugs
I'm sorry for spamming the mailing list with incomplete messages. It seems =
that my 'enter' function does not work correctly :)


it seems that PostgreSQL jdbc driver returns incorrect code during on call =
of commit during 2PC. Currently the driver returns XAER_RMERR.
I expect that it's this call
https://github.com/pgjdbc/pgjdbc/blob/master/org/postgresql/xa/PGXAConnecti=
on.java#L528

But the XA spec (http://pubs.opengroup.org/onlinepubs/009680699/toc.pdf) sa=
ys for XAER_RMERR that
"An error occurred in committing the work performed on behalf of the transa=
ction
branch and the branch=E2=80=99s work has been rolled back. Note that return=
ing this error
signals a catastrophic event to a transaction manager since other resource
managers may successfully commit their work on behalf of this branch. This =
error
should be returned only when a resource manager concludes that it can never
commit the branch and that it cannot hold the branch=E2=80=99s resources in=
 a prepared
state. Otherwise, [XA_RETRY] should be returned."

In case there is longer discussion about scenario hitting this issue and ab=
out handling this at RedHat bugzilla here:
https://bugzilla.redhat.com/show_bug.cgi?id=3D988724

From what is said here I think that PostgreSQL database should rollback the=
 transaction itself and then it could return XAException error code XAER_RM=
ERR or it should return
XAER_RMFAIL or XAER_RETRY.

Would you mind my opening a issue for PostgreSQL jdbc driver?

Thank you
Ondra Chaloupka

pgsql-bugs by date:

Previous
From: Ondrej Chaloupka
Date:
Subject: Incorrect return code for error on call of commit during 2PC
Next
From: Tom Lane
Date:
Subject: Re: pg_restore crashes passing NULL to strcmp (9.4 rc1)