Re: Synchronous replication - patch status inquiry

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, fazool mein <fazoolmein(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Synchronous replication - patch status inquiry
Date: 2010-09-03 10:31:07
Message-ID: 4C80CE6B.3050505@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/09/10 13:20, Simon Riggs wrote:
> On Fri, 2010-09-03 at 12:33 +0300, Heikki Linnakangas wrote:
>> On 03/09/10 10:45, Simon Riggs wrote:
>>> On Fri, 2010-09-03 at 09:55 +0300, Heikki Linnakangas wrote:
>>>> On 03/09/10 09:36, Simon Riggs wrote:
>>>>> On Fri, 2010-09-03 at 12:50 +0900, Fujii Masao wrote:
>>>>>> That design would affect what the standby should reply. If we choose
>>>>>> async/recv/fsync/replay on a per-transaction basis, the standby
>>>>>> should send multiple LSNs and the master needs to decide when
>>>>>> replication has been completed. OTOH, if we choose just sync/async,
>>>>>> the standby has only to send one LSN.
>>>>>>
>>>>>> The former seems to be more useful, but triples the number of ACK
>>>>>> from the standby. I'm not sure whether its overhead is ignorable,
>>>>>> especially when the distance between the master and the standby is
>>>>>> very long.
>>>>>
>>>>> No, it doesn't. There is no requirement for additional messages.
>>>>
>>>> Please explain how you do it then. When a commit record is sent to the
>>>> standby, it needs to acknowledge it 1) when it has received it, 2) when
>>>> it fsyncs it to disk and c) when it's replayed. I don't see how you can
>>>> get around that.
>>>>
>>>> Perhaps you can save a bit by combining multiple messages together, like
>>>> in Nagle's algorithm, but then you introduce extra delays which is
>>>> exactly what you don't want.
>>>
>>>> From my perspective, you seem to be struggling to find reasons why this
>>> should not happen, rather than seeing the alternatives that would
>>> obviously present themselves if your attitude was a positive one. We
>>> won't make any progress with this style of discussion.
>>
>> Huh? You made a very clear claim above that you don't need additional
>> messages. I explained why I don't think that's true, and asked you to
>> explain why you think it is true. Whether the claim is true or not does
>> not depend on my attitude.
>
> Why exactly would we need to send 3 messages when we could send 1?
> Replace your statements of "it needs to" with "why would it" instead.

(scratches head..) What's the point of differentiating
received/fsynced/replayed, if the master receives the ack for all of
them at the same time?

Let's try this with an example: In the master, I do stuff and commit a
transaction. I want to know when the transaction is fsynced in the
standby. The WAL is sent to the standby, up to the commit record.

Upthread you said that:

> The standby does *not* need
> to know the wishes of transactions on the master.

So, when does standby send the single message back to the master?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-09-03 10:50:54 Re: Interruptible sleeps (was Re: CommitFest 2009-07: Yay, Kevin! Thanks, reviewers!)
Previous Message Simon Riggs 2010-09-03 10:20:09 Re: Synchronous replication - patch status inquiry