Re: pg_receivewal documentation

From: Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_receivewal documentation
Date: 2019-07-19 17:01:27
Message-ID: ab8f78b5-4b9f-e31d-daee-c398424fae8c@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 7/18/19 9:09 PM, Michael Paquier wrote:
>> pg_receivewal -D /tmp/wal -S replica1 --synchronous -h localhost -p 5432 -U
>> repluser -W
>> psql -c 'SELECT * FROM pg_stat_replication;' postgres
>> psql -c 'SELECT * FROM pg_replication_slots;' postgres
>> psql -c 'CREATE DATABASE test' postgres
>>
>> In what scenarios do you see 'on' working ?
>
> Because the code says so, "on" is an alias for "remote_flush" (which
> is not user-visible by the way):
> src/include/access/xact.h:#define SYNCHRONOUS_COMMIT_ON
> SYNCHRONOUS_COMMIT_REMOTE_FLUSH
>
> And if you do that it works fine (pg_receivewal --synchronous runs in
> the background and I created a dummy table):
> =# SELECT application_name, sync_state, flush_lsn, replay_lsn FROM
> pg_stat_replication;
> application_name | sync_state | flush_lsn | replay_lsn
> ------------------+------------+-----------+------------
> pg_receivewal | sync | 0/15E1F88 | null
> (1 row)
> =# set synchronous_commit to on ;
> SET
> =# insert into aa values (2);
> INSERT 0 1
>

I forgot to use pg_receivewal -d with application_name instead of -h -p -U.

Maybe we should have an explicit option for that, but that is a separate
thread.

Best regards,
Jesper

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Pedersen 2019-07-19 17:02:21 Re: pg_receivewal documentation
Previous Message Andres Freund 2019-07-19 16:52:41 Re: partition routing layering in nodeModifyTable.c