pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgreSQL JDBC bug with XA recovery?
3+ messages / 3 participants
[nested] [flat]
* PostgreSQL JDBC bug with XA recovery?
@ 2013-02-28 14:54 Andrew Frolov <andrewfrolov@gmail.com>
2013-02-28 15:23 ` Re: PostgreSQL JDBC bug with XA recovery? Heikki Linnakangas <hlinnakangas@vmware.com>
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Frolov @ 2013-02-28 14:54 UTC (permalink / raw)
To: pgsql-jdbc; +Cc: heikki.linnakangas@iki.fi
Hi!
I've encountered a problem with xa transaction recovery.
PGXAConnection.recover() functions returns all pending XA transactions.
But the problem is, that in general case we cannot recover this
transactions in current connection, PostgreSQL require us to connect to
target database before recovering. This behavior breaks the expectations
of transaction managers. We literally can't perform recovery if we have
a lot of pending xa transactions in different databases in PostgreSQL
cluster.
Maybe it would be good to replace
SELECT gid FROM pg_prepared_xacts
by
SELECT gid FROM pg_prepared_xacts,where owner = current_user ?
I found an old thread with same question, but without an answer.
http://www.postgresql.org/message-id/CAPSK6ngYLaRAy_FGGQqknTPE9FUDCRn32UShxuncWEyD+swD=w@mail.gmail....
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PostgreSQL JDBC bug with XA recovery?
2013-02-28 14:54 PostgreSQL JDBC bug with XA recovery? Andrew Frolov <andrewfrolov@gmail.com>
@ 2013-02-28 15:23 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2013-02-28 16:28 ` Re: PostgreSQL JDBC bug with XA recovery? Андрей Фролов <andrewfrolov@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Heikki Linnakangas @ 2013-02-28 15:23 UTC (permalink / raw)
To: Andrew Frolov <andrewfrolov@gmail.com>; +Cc: pgsql-jdbc; andrey.o.vorobiev@gmail.com
On 28.02.2013 16:54, Andrew Frolov wrote:
> I've encountered a problem with xa transaction recovery.
>
> PGXAConnection.recover() functions returns all pending XA transactions.
> But the problem is, that in general case we cannot recover this
> transactions in current connection, PostgreSQL require us to connect to
> target database before recovering. This behavior breaks the expectations
> of transaction managers. We literally can't perform recovery if we have
> a lot of pending xa transactions in different databases in PostgreSQL
> cluster.
>
> Maybe it would be good to replace
> SELECT gid FROM pg_prepared_xacts
> by
> SELECT gid FROM pg_prepared_xacts,where owner = current_user ?
>
> I found an old thread with same question, but without an answer.
> http://www.postgresql.org/message-id/CAPSK6ngYLaRAy_FGGQqknTPE9FUDCRn32UShxuncWEyD+swD=w@mail.gmail....
There's some confusion here. Both you and the old thread talks about
transactions in multiple databases being the problem, but the error
message, and your suggestion above, suggest that the problem is actually
about permissions. We probably should do:
SELECT gid FROM pg_prepared_xacts where database = current_database()
That should help with the problem with multiple databases. But do you
also have a problem with multiple PostgreSQL users being involved?
- Heikki
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: PostgreSQL JDBC bug with XA recovery?
2013-02-28 14:54 PostgreSQL JDBC bug with XA recovery? Andrew Frolov <andrewfrolov@gmail.com>
2013-02-28 15:23 ` Re: PostgreSQL JDBC bug with XA recovery? Heikki Linnakangas <hlinnakangas@vmware.com>
@ 2013-02-28 16:28 ` Андрей Фролов <andrewfrolov@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Андрей Фролов @ 2013-02-28 16:28 UTC (permalink / raw)
To: Heikki Linnakangas <hlinnakangas@vmware.com>; +Cc: pgsql-jdbc; andrey.o.vorobiev@gmail.com
Sorry, my fault. I've just copy-pasted SQL from previous topic. We have a
problem with multiple databases, it has nothing to do with users and
privileges.
What do we want, is
SELECT gid FROM pg_prepared_xacts where database = current_database()
in PGXAConnection.recover() function.
As I understand, you agree that it will fix the problem with multiple
databases. Could you please make a fix in official code shortly?
Thanks!
28.02.2013 18:23, Heikki Linnakangas пишет:
On 28.02.2013 16:54, Andrew Frolov wrote:
I've encountered a problem with xa transaction recovery.
PGXAConnection.recover() functions returns all pending XA transactions.
But the problem is, that in general case we cannot recover this
transactions in current connection, PostgreSQL require us to connect to
target database before recovering. This behavior breaks the expectations
of transaction managers. We literally can't perform recovery if we have
a lot of pending xa transactions in different databases in PostgreSQL
cluster.
Maybe it would be good to replace
SELECT gid FROM pg_prepared_xacts
by
SELECT gid FROM pg_prepared_xacts,where owner = current_user ?
I found an old thread with same question, but without an answer.
http://www.postgresql.org/message-id/CAPSK6ngYLaRAy_FGGQqknTPE9FUDCRn32UShxuncWEyD+swD=w@mail.gmail....
There's some confusion here. Both you and the old thread talks about
transactions in multiple databases being the problem, but the error
message, and your suggestion above, suggest that the problem is actually
about permissions. We probably should do:
SELECT gid FROM pg_prepared_xacts where database = current_database()
That should help with the problem with multiple databases. But do you also
have a problem with multiple PostgreSQL users being involved?
- Heikki
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2013-02-28 16:28 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28 14:54 PostgreSQL JDBC bug with XA recovery? Andrew Frolov <andrewfrolov@gmail.com>
2013-02-28 15:23 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2013-02-28 16:28 ` Андрей Фролов <andrewfrolov@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox