Re: Time-Delayed Standbys

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Time-Delayed Standbys
Date: 2013-12-12 09:09:21
Message-ID: CA+U5nMLfpDp-X3h8Uzztqve1mLw+chJ=akPVzoPDsc35Zdn3TA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9 December 2013 10:54, KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> (2013/12/09 19:35), Pavel Stehule wrote:
>>
>>
>>
>>
>> 2013/12/9 KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp
>> <mailto:kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>>
>>
>>
>> Hi Fabrízio,
>>
>> I test your v4 patch, and send your review comments.
>>
>> * Fix typo
>> > 49 -# commited transactions from the master, specify a recovery
>> time delay.
>> > 49 +# committed transactions from the master, specify a recovery
>> time delay.
>>
>> * Fix white space
>> > 177 - if (secs <= 0 && microsecs <=0)
>> > 177 + if (secs <= 0 && microsecs <=0 )
>>
>> * Add functionality (I propose)
>> We can set negative number at min_standby_apply_delay. I think that
>> this feature
>> is for world wide replication situation. For example, master server is
>> in
>> Japan and slave server is in San Francisco. Japan time fowards than
>> San
>> Francisco time
>> . And if we want to delay in this situation, it can need negative
>> number in
>> min_standby_apply_delay. So I propose that time delay conditional
>> branch
>> change under following.
>> > - if (min_standby_apply_delay > 0)
>> > + if (min_standby_apply_delay != 0)
>> What do you think? It might also be working collectry.
>>
>>
>> what using interval instead absolute time?
>
> This is because local time is recorded in XLOG. And it has big cost for
> calculating global time.

I agree with your request here, but I don't think negative values are
the right way to implement that, at least it would not be very usable.

My suggestion would be to add the TZ to the checkpoint record. This
way all users of WAL can see the TZ of the master and act accordingly.
I'll do a separate patch for that.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-12-12 09:23:17 Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Previous Message Simon Riggs 2013-12-12 08:45:01 Re: Time-Delayed Standbys