From:
Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To:
Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc:
Aidan Van Dyk <aidan(at)highrise(dot)ca>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject:
Re: Re: [COMMITTERS] pgsql: Make standby server continuously retry restoring the next WAL
Date:
2010-03-18 14:27:59
Message-ID:
3f0b79eb1003180727g7877743eq81274e014fe70a49@mail.gmail.com (view raw or flat )
Thread:
2010-01-27 15:27:51 from heikki(at)postgresql(dot)org (Heikki Linnakangas)
2010-02-10 05:05:55 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-02-10 07:32:48 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-10 09:19:01 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-02-10 13:45:00 from Aidan Van Dyk <aidan(at)highrise(dot)ca>
2010-02-10 16:53:34 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 10:37:37 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-11 12:22:16 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 12:27:28 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-11 12:44:09 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 13:06:39 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-11 13:28:51 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 13:46:56 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-11 14:01:18 from Aidan Van Dyk <aidan(at)highrise(dot)ca>
2010-02-11 14:17:48 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 14:42:04 from Aidan Van Dyk <aidan(at)highrise(dot)ca>
2010-02-11 17:04:41 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 17:31:54 from Aidan Van Dyk <aidan(at)highrise(dot)ca>
2010-02-11 18:11:38 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 18:22:44 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2010-02-11 19:45:13 from Garick Hamlin <ghamlin(at)isc(dot)upenn(dot)edu>
2010-02-11 18:08:24 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-11 18:14:12 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-12 07:37:40 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 17:29:33 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 18:11:01 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-18 11:37:18 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-03-17 10:35:37 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-17 10:49:11 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-03-18 14:27:59 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-03-19 08:52:04 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-03-19 11:37:08 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-19 12:43:34 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-03-19 12:50:34 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-19 13:28:48 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2010-03-19 13:44:53 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-23 07:17:53 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-03-24 12:31:06 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-24 13:20:45 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-03-24 13:36:33 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-03-25 12:55:42 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-25 13:43:53 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-03-26 05:24:35 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-03-30 16:28:28 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-31 02:01:40 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-03-25 12:48:27 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-24 23:23:01 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-03-25 02:08:06 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-03-25 02:14:37 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-03-25 08:11:45 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-25 08:23:47 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-03-25 10:26:25 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-25 10:47:07 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-25 19:48:06 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-03-25 08:08:11 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-03-25 10:15:15 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-03-25 19:45:22 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-03-25 08:22:55 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-03-25 10:05:37 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 13:41:15 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-02-11 13:50:50 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-11 13:55:56 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 14:17:14 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-11 14:22:54 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 14:38:40 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-11 15:21:13 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-11 15:29:38 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2010-02-11 14:55:11 from Greg Smith <greg(at)2ndquadrant(dot)com>
2010-02-12 05:38:32 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-02-12 12:51:20 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-12 13:10:21 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-12 15:47:42 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-02-12 16:10:05 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2010-02-15 06:29:57 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2010-02-12 14:34:29 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2010-02-12 17:25:02 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-02-12 17:47:49 from Greg Stark <stark(at)mit(dot)edu>
Lists:
pgsql-committers pgsql-docs pgsql-hackers
On Wed, Mar 17, 2010 at 7:35 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Fujii Masao wrote:
>> I found another missing feature in new file-based log shipping (i.e.,
>> standby_mode is enabled and 'cp' is used as restore_command).
>>
>> After the trigger file is found, the startup process with pg_standby
>> tries to replay all of the WAL files in both pg_xlog and the archive.
>> So, when the primary fails, if the latest WAL file in pg_xlog of the
>> primary can be read, we can prevent the data loss by copying it to
>> pg_xlog of the standby before creating the trigger file.
>>
>> On the other hand, the startup process with standby mode doesn't
>> replay the WAL files in pg_xlog after the trigger file is found. So
>> failover always causes the data loss even if the latest WAL file can
>> be read from the primary. And if the latest WAL file is copied to the
>> archive instead, it can be replayed but a PANIC error would happen
>> because it's not filled.
>>
>> We should remove this restriction?
>
> Looking into this, I realized that we have a bigger problem related to
> this. Although streaming replication stores the streamed WAL files in
> pg_xlog, so that they can be re-replayed after a standby restart without
> connecting to the master, we don't try to replay those either. So if you
> restart standby, it will fail to start up if the WAL it needs can't be
> found in archive or by connecting to the master. That must be fixed.
I agree that this is a bigger problem. Since the standby always starts
walreceiver before replaying any WAL files in pg_xlog, walreceiver tries
to receive the WAL files following the REDO starting point even if they
have already been in pg_xlog. IOW, the same WAL files might be shipped
from the primary to the standby many times. This behavior is unsmart,
and should be addressed.
Regards,
--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
In response to
Responses
pgsql-docs by date
Next :From: Tim LandscheidtDate: 2010-03-18 15:52:31
Subject : [PATCH] Explain generate_subscripts() more clearly
Previous :From : Magnus HaganderDate : 2010-03-17 18:04:12
Subject : Re: The type of ssl_renegotiation_limit
pgsql-hackers by date
Next :From: Tom LaneDate: 2010-03-18 14:40:32
Subject : Re: WIP: shared ispell dictionary
Previous :From : Pavel StehuleDate : 2010-03-18 12:06:04
Subject : Re: WIP: shared ispell dictionary
pgsql-committers by date
Next :From: Tom LaneDate: 2010-03-18 15:29:45
Subject : pgsql: Fix missing parentheses for current_query(), per bug #5378.
Previous :From : Peter EisentrautDate : 2010-03-18 13:23:57
Subject : pgsql: Use data-type specific conversion functions also in plpy.execute