Re: time-delayed standbys - Mailing list pgsql-hackers

From Greg Stark
Subject Re: time-delayed standbys
Date
Msg-id BANLkTimQG+58K2g04benfc4OLW=AhJo2cw@mail.gmail.com
Whole thread Raw
In response to Re: time-delayed standbys  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Apr 20, 2011 at 3:41 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Greg Stark <gsstark@mit.edu> writes:
>> Ah, so we did put the master's clock in every message?
>
> Yes, we did.

And by "we" I mean "you".... I realize I'm tossing in comments from
the peanut gallery to you and especially Robert who worked on this
stuff a lot already.


>> Then this
>> should be simple, no? Just compare the master's timestamp from the
>> record to the last master's clock seen in the messages. That sounds
>> equivalent but a lot safer than trying to keep a conversion between
>> them.
>
> Well, the question is what happens after you stop receiving master
> messages.  If you don't make use of the slave's clock somehow,
> application of WAL will stop dead in the water, which seems unlikely
> to be what's wanted.

I'm not convinced that's so bad. But even so the logic could be:

wait until (master.last_time_seen > this_record.master-timestamp+n minutes ||              gettimeofday() >
this_record.local_time_when_received+nminutes) 




--
greg


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgindent weirdness
Next
From: Alvaro Herrera
Date:
Subject: Re: Formatting Curmudgeons WAS: MMAP Buffers