From:
Robert Haas <robertmhaas(at)gmail(dot)com>
To:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc:
Simon Riggs <simon(at)2ndquadrant(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject:
Re: Keepalive for max_standby_delay
Date:
2010-07-02 20:20:46
Message-ID:
AANLkTinlTL_dQogSzNWaf72-ovl3d8PeWE8ZRwrErxTw@mail.gmail.com (view raw or flat )
Thread:
2010-05-15 13:17:10 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-15 15:45:52 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-05-15 16:23:58 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-15 16:30:38 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-05-15 16:49:07 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-15 17:05:41 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-05-15 17:24:30 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-15 18:50:55 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-15 20:08:20 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-05-15 21:05:49 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-05-16 15:53:32 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-17 08:40:50 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-18 21:06:26 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-05-18 21:17:46 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-18 21:25:46 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-05-18 21:37:39 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-26 22:34:59 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-05-26 22:44:24 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-26 22:45:09 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-05-26 22:52:04 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-26 23:22:40 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-05-27 17:26:26 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-31 18:40:02 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-06-02 16:41:53 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-02 16:59:05 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2010-06-01 10:36:59 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-06-01 11:04:48 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-02 17:14:33 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-02 17:36:52 from Stephen Frost <sfrost(at)snowman(dot)net>
2010-06-02 17:45:56 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-02 18:03:50 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-02 18:13:19 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-06-02 17:44:26 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2010-06-02 18:23:44 from Greg Stark <gsstark(at)mit(dot)edu>
2010-06-02 19:14:24 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-02 22:59:23 from Greg Stark <gsstark(at)mit(dot)edu>
2010-06-02 23:11:08 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-03 00:47:10 from Stephen Frost <sfrost(at)snowman(dot)net>
2010-06-03 15:07:10 from Greg Stark <gsstark(at)mit(dot)edu>
2010-06-03 15:18:06 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-03 15:27:51 from Greg Stark <gsstark(at)mit(dot)edu>
2010-06-03 15:34:43 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-03 15:43:54 from Greg Stark <gsstark(at)mit(dot)edu>
2010-06-02 18:27:37 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-02 18:35:10 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-06-03 16:47:47 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-03 17:18:24 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-03 17:32:45 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-03 17:46:31 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-03 22:48:48 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-03 23:02:00 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-09 22:52:31 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-10 00:01:58 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-17 01:49:56 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-06-17 01:56:00 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-17 02:03:36 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-06-21 04:20:33 from Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
2010-06-21 12:53:06 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-06-28 07:17:48 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-28 14:03:02 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-06-28 14:19:09 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-28 17:09:40 from Josh Berkus <josh(at)agliodbs(dot)com>
2010-06-30 19:08:16 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-30 21:57:04 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-06-28 17:24:32 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-06-28 18:26:19 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-28 18:55:59 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-07-02 20:11:35 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-07-02 20:20:46 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-07-02 20:36:22 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-07-02 20:40:58 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-07-02 20:52:08 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-07-02 21:01:15 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-07-03 11:59:10 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-07-03 15:32:09 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-07-03 19:17:48 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-07-03 20:18:11 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-02 18:44:43 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-02 19:14:45 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-06-02 19:21:36 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-03 09:18:50 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-06-03 13:47:19 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-02 19:40:21 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-06-02 19:50:17 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-02 20:20:08 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-06-02 20:53:36 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-06-03 15:26:07 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-02 19:41:49 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-06-02 20:00:47 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-03 07:56:54 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-03 16:58:45 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-06-03 12:14:53 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-06-03 08:56:49 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-06-03 09:07:39 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-06-03 09:39:48 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-06-03 10:57:33 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-17 02:18:37 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-05-16 16:11:35 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-17 02:51:13 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-05-17 07:07:04 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-26 22:47:58 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-05-17 16:36:07 from Jim Nasby <decibel(at)decibel(dot)org>
2010-05-18 21:08:13 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-05-18 21:21:45 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
Lists:
pgsql-hackers
On Fri, Jul 2, 2010 at 4:11 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> [ Apologies for the very slow turnaround on this --- I got hit with
> another batch of non-postgres security issues this week. ]
>
> Attached is a draft patch for revising the max_standby_delay behavior into
> something I think is a bit saner. There is some unfinished business:
>
> * I haven't touched the documentation yet
>
> * The code in xlog.c needs to be reverted to its former behavior so that
> recoveryLastXTime means what it's supposed to mean, ie just the last
> commit/abort timestamp.
>
> However neither of these affects the testability of the patch.
>
> Basically the way that it works is that the standby delay is computed with
> reference to XLogReceiptTime rather than any timestamp obtained from WAL.
> XLogReceiptTime is set to current time whenever we obtain a WAL segment
> from the archives or when we begin processing a fresh batch of WAL from
> walreceiver. There's a subtlety in the streaming case: we don't advance
> XLogReceiptTime if we are not caught up, that is if the startup process
> is more than one flush cycle behind walreceiver. In the normal case
> we'll advance XLogReceiptTime on each flush cycle, but once we start
> falling behind, it doesn't move so the grace time alloted to conflicting
> queries begins to decrease.
>
> I split max_standby_delay into two GUC variables, as previously
> threatened: max_standby_archive_delay and max_standby_streaming_delay.
> The former applies when processing data read from archive, the latter
> when processing data received from walreceiver. I think this is really
> quite important given the new behavior, because max_standby_archive_delay
> ought to be set with reference to the expected time to process one WAL
> segment, whereas max_standby_streaming_delay doesn't depend on that value
> at all. I'm not sure what good defaults are for these values, so I left
> them at 30 seconds for the moment. I'm inclined to think
> max_standby_archive_delay ought to be quite a bit less though.
>
> It might be worth adding a minimum-grace-time limit as we previously
> discussed, but this patch doesn't attempt to do that.
>
> Comments?
I haven't been able to wrap my head around why the delay should be
LESS in the archive case than in the streaming case. Can you attempt
to hit me with the clue-by-four?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company
In response to
Responses
pgsql-hackers by date
Next :From: Tom LaneDate: 2010-07-02 20:36:22
Subject : Re: Keepalive for max_standby_delay
Previous :From : Robert HaasDate : 2010-07-02 20:18:54
Subject : Re: [COMMITTERS] pgsql: Allow copydir() to be interrupted.