From: | Boszormenyi Zoltan <zboszor(at)pr(dot)hu> |
---|---|
To: | Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: PG wire protocol question |
Date: | 2016-05-18 10:05:16 |
Message-ID: | 0f7027ee-80ce-4223-9a24-7a4b44568cb1@pr.hu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
2016-05-17 15:29 keltezéssel, Albe Laurenz írta:
> Boszormenyi Zoltan wrote:
>> it was a long time I have read this list or written to it.
>>
>> Now, I have a question. This blog post was written about 3 years ago:
>> https://aphyr.com/posts/282-jepsen-postgres
>>
>> Basically, it talks about the client AND the server as a system
>> and if the network is cut between sending COMMIT and
>> receiving the answer for it, the client has no way to know
>> whether the transaction was actually committed.
>>
>> The client connection may just timeout and a reconnect would
>> give it a new connection but it cannot pick up its old connection
>> where it left. So it cannot really know whether the old transaction
>> was committed or not, possibly without doing expensive queries first.
>>
>> Has anything changed on that front?
> That blog post seems ill-informed - that has nothing to do with
> two-phase commit.
In the blog post 2pc was mentioned related to the communication,
not as a transaction control inside the database. I wouldn't call
it misinformed. After all, terminology can mean different things
in different contexts.
> The problem - that the server may commit a transaction, but the client
> never receives the server's response - is independent of whether
> two-phase commit is used or not.
>
> This is not a problem of PostgreSQL, it is a generic problem of communication.
Indeed.
> What would be the alternative?
> That the server has to wait for the client to receive the commit response?
Not quite. That would mean constantly sending an ack that the other
received the last ack, which would be silly.
If the network connection is cut, the client should be able to
reconnect to the old backend and query the last state and continue
where it left, maybe confirming via some key or UUID that it was
indeed the client that connected previously.
> But what if the client received the message and the server or the network
> go down before the server learns of the fact?
> You see that this would lead to an infinite regress.
>
> Yours,
> Laurenz Albe
>
From | Date | Subject | |
---|---|---|---|
Next Message | Adam Brusselback | 2016-05-18 15:44:01 | Re: Thoughts on "Love Your Database" |
Previous Message | hmzha2 | 2016-05-18 06:55:46 | Re: Fast way to delete big table? |