Обсуждение: Re: [COMMITTERS] pgsql: Add --synchronous option to pg_receivexlog, for more reliable WA

Поиск
Список
Период
Сортировка

Re: [COMMITTERS] pgsql: Add --synchronous option to pg_receivexlog, for more reliable WA

От
Peter Eisentraut
Дата:
On 11/17/14 12:34 PM, Fujii Masao wrote:
> Add --synchronous option to pg_receivexlog, for more reliable WAL writing.

The last two sentences of this piece of documentation are a bit
hand-wavy and hard to parse.  Could you clarify this?
    <varlistentry>     <term><option>-S <replaceable>slotname</replaceable></option></term>
<term><option>--slot=<replaceableclass="parameter">slotname</replaceable></option></term>     <listitem>       <para>
    Require <application>pg_receivexlog</application> to use an existing        replication slot (see <xref
linkend="streaming-replication-slots">).       When this option is used, <application>pg_receivexlog</> will report
  a flush position to the server, indicating when each segment has been        synchronized to disk so that the server
canremove that segment if it        is not otherwise needed. <literal>--synchronous</literal> option must        be
specifiedwhen making <application>pg_receivexlog</> run as        synchronous standby by using replication slot.
OtherwiseWAL data        cannot be flushed frequently enough for this to work correctly.       </para>     </listitem>
 </varlistentry>
 




Re: [COMMITTERS] pgsql: Add --synchronous option to pg_receivexlog, for more reliable WA

От
Fujii Masao
Дата:
On Wed, Sep 16, 2015 at 11:25 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On 11/17/14 12:34 PM, Fujii Masao wrote:
>> Add --synchronous option to pg_receivexlog, for more reliable WAL writing.
>
> The last two sentences of this piece of documentation are a bit
> hand-wavy and hard to parse.  Could you clarify this?

I think that what those sentences try to point is; to make pg_receivexlog run
as synchronous standby expectedly, both --slot and --synchronous options need
to be specified.

If --slot option is specified, pg_receivexlog reports a flush position to
the server even though --synchronous is not specified. So users might think
that --synchrnous option is not necessary for synchronous pg_receivexlog
setting. But that's not true. If --synchronous option is not specified, the
received WAL data is flushed to the disk only when WAL segment is switched.
So the transactions on the master need to wait for a long time, i.e.,
we can think that synchronous pg_receivexlog doesn't work smoothly.
To avoid such situation, --synchronous option also needs to be specified and
which makes pg_receivexlog flush WAL data immediately after receiving it.

Regards,

-- 
Fujii Masao



Re: Re: [COMMITTERS] pgsql: Add --synchronous option to pg_receivexlog, for more reliable WA

От
Peter Eisentraut
Дата:
On 9/15/15 11:04 PM, Fujii Masao wrote:
> If --slot option is specified, pg_receivexlog reports a flush position to
> the server even though --synchronous is not specified. So users might think
> that --synchrnous option is not necessary for synchronous pg_receivexlog
> setting. But that's not true. If --synchronous option is not specified, the
> received WAL data is flushed to the disk only when WAL segment is switched.
> So the transactions on the master need to wait for a long time, i.e.,
> we can think that synchronous pg_receivexlog doesn't work smoothly.
> To avoid such situation, --synchronous option also needs to be specified and
> which makes pg_receivexlog flush WAL data immediately after receiving it.

Thank you for this information.  I hope to have clarified this in the
documentation now.