Maybe we should provide the better way to check whether the specified transaction is committed or not?https://twitter.com/fujii_masao/status/925045443083476992 …
-
-
Replying to @fujii_masao
For this problem 2PC is quite the appropriate solution. We could make it easier to avoid the additional roundtrip however.
1 reply 0 retweets 0 likes -
Replying to @AndresFreundTec @fujii_masao
I.e. today you can already do PREPARE and then once that's ack'ed COMMIT PREPARED. Repeat latter if no ack received.
2 replies 0 retweets 0 likes -
Replying to @AndresFreundTec
So the repeat would fail if tx is already committed. But it seems to also fail if the server crashes before PREPARE and then restarts. No?
2 replies 0 retweets 0 likes -
Replying to @fujii_masao
No. If unsure whether PREPARE succeeded client can inquire that. And then loop sending COMMIT/ROLLBACK PREPARED.
1 reply 0 retweets 0 likes -
Replying to @AndresFreundTec
"inquire" means, e.g., to check pg_prepared_xacts ?
1 reply 0 retweets 0 likes -
Replying to @fujii_masao
That, or just send ROLLBACK PREPARED till it either succeeds, or fails with an "unknown" error.
1 reply 0 retweets 0 likes -
Replying to @AndresFreundTec
Yes, so a client needs to interpret the error code, and do the appropriate action per that.
1 reply 0 retweets 0 likes
If you always ROLLBACK in that case, you just need to do it till you get *either* response.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.