Re: pgsql: Have pg_receivexlog always send an invalid log position in statu - Mailing list pgsql-committers

From Fujii Masao
Subject Re: pgsql: Have pg_receivexlog always send an invalid log position in statu
Date
Msg-id CAHGQGwHyL4_m=aReh+bbmx7cbhkmXx_q74JXj5KYZjAnKL9=_w@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Have pg_receivexlog always send an invalid log position in statu  (Magnus Hagander <magnus@hagander.net>)
Responses Re: pgsql: Have pg_receivexlog always send an invalid log position in statu
List pgsql-committers
On Fri, Feb 10, 2012 at 8:14 AM, Magnus Hagander <magnus@hagander.net> wrote:
> On Thu, Feb 9, 2012 at 17:35, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com> wrote:
>> On 09.02.2012 15:14, Magnus Hagander wrote:
>>>
>>> Have pg_receivexlog always send an invalid log position in status messages
>>>
>>> This prevents pg_basebackup and pg_receivexlog from becoming a synchronous
>>> standby in case 'write' is used for synchronous_commit.
>>
>>
>> It's not completely crazy to use pg_receivexlog as a synchronous standby. It
>> provides the zero-loss property like a real standby does, ie. if the master
>> dies after sending the WAL to pg_receivexlog, that transaction is safe in
>> the archive.
>
> Yes, but as I stated in the email in the thread that the patch was
> posted in, I think this should not be the default behaviour, but it
> should be available as a commandline option, or something along that
> line.

Even if we make that the default behavior, pg_receivexlog doesn't work as
a sync standby unless synchronous_standby_names is set to "pg_receivexlog"
or "*". There is little risk that we make that the default, I think... No?

Anyway, to consider pg_receivexlog as a sync standby, we need to change it
so that its status report includes the valid write and flush
positions, and so that
it replies as soon as it writes or flushes the received WAL, like real
sync standby
does. Otherwise, the master has to wait for the status report interval (which is
specified in -s or --statusint option of pg_receivexlog).

The proposed change would increase the frequency for pg_receivexlog to send
back the report very much. Which might be a problem. For people who want to
avoid such frequent reports, we might need to introduce the option
which specifies
whether frequent report is allowed or not.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

pgsql-committers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pgsql: Have pg_receivexlog always send an invalid log position in statu
Next
From: Tom Lane
Date:
Subject: pgsql: Add ORDER BY to a query to prevent occasional regression test fa