Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3739A1337B93 for ; Wed, 20 Apr 2011 11:19:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 84219-02 for ; Wed, 20 Apr 2011 14:19:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id AF6E21337B54 for ; Wed, 20 Apr 2011 11:19:37 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p3KEJZgg026008; Wed, 20 Apr 2011 10:19:35 -0400 (EDT) To: Greg Stark cc: Robert Haas , pgsql-hackers@postgresql.org Subject: Re: time-delayed standbys In-reply-to: References: Comments: In-reply-to Greg Stark message dated "Wed, 20 Apr 2011 15:07:38 +0100" Date: Wed, 20 Apr 2011 10:19:35 -0400 Message-ID: <26007.1303309175@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/1024 X-Sequence-Number: 186226 Greg Stark writes: > On Wed, Apr 20, 2011 at 2:19 PM, Robert Haas wrote: >> How would we keep track of the most recent timestamp received from the >> master without replaying the WAL records? > Well as we receive them we would have to peek at them to see the time. > Or we could have the master send its time to the slave as I believe > Tom has already proposed in the past but I believe didn't choose to > do? My idea of how to manage it would be to have walreceiver explicitly track the clock difference from the master, which it can do since walsender puts its current time into every message header. You can use the slave's clock for comparisons so long as you add the appropriate offset. (The theory here is that the skew won't change very fast ...) regards, tom lane