pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off
3+ messages / 3 participants
[nested] [flat]

* BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off
@ 2014-09-29 07:45 amutu@amutu.com
  2014-09-29 08:02 ` Re: BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: amutu@amutu.com @ 2014-09-29 07:45 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      11517
Logged by:          the pg_stat_replication.sync_stat show sync when synchronous_commit is set
to be off
Email address:      amutu@amutu.com
PostgreSQL version: 9.2.4
Operating system:   suse linux 10 x86_64
Description:        

from the doc,when synchronous_commit set to off or local,the commit will not
wait the remote slave reveive data,so it is not asynchronous replication.but
I find the pg_stat_replication wrongly report the sync_stat to sync.This can
be confused for people.

postgres=# select * from pg_stat_replication ;
-[ RECORD 1 ]----+------------------------------
pid              | 3213
usesysid         | 16387
usename          | rep
application_name | sync_slave
client_addr      | 172.25.38.154
client_hostname  | 
client_port      | 54333
backend_start    | 2014-09-29 15:17:19.927457+08
state            | streaming
sent_location    | 21/A0F01C0
write_location   | 21/A0F01C0
flush_location   | 21/A0F01C0
replay_location  | 21/A0EFC88
sync_priority    | 1
sync_state       | sync

postgres=# show synchronous_standby_names ;
-[ RECORD 1 ]-------------+-----------------------
synchronous_standby_names | sync_slave,walreceiver


postgres=# show synchronous_commit ;          
-[ RECORD 1 ]------+----
synchronous_commit | off


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off
  2014-09-29 07:45 BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off amutu@amutu.com
@ 2014-09-29 08:02 ` Michael Paquier <michael.paquier@gmail.com>
  2014-09-29 09:22   ` Re: BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off Jov <amutu@amutu.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Michael Paquier @ 2014-09-29 08:02 UTC (permalink / raw)
  To: amutu@amutu.com; +Cc: pgsql-bugs

On Mon, Sep 29, 2014 at 4:45 PM, <amutu@amutu.com> wrote:

> from the doc,when synchronous_commit set to off or local,the commit will
> not
> wait the remote slave reveive data,so it is not asynchronous
> replication.but I
> find the pg_stat_replication wrongly report the sync_stat to sync.This can

This is not a bug, please refer to the documentation about
synchronous_commit:
http://www.postgresql.org/docs/devel/static/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT

When synchronous_commit is set to off, local or remote_write, the master
node does not wait for the confirmation from the sync standby that the WAL
has been flushed to disk (for remote_write it waits for the write
confirmation), and the standby is still considered as sync, of course if
synchronous_standby_names is set.
Regards,
-- 
Michael

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off
  2014-09-29 07:45 BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off amutu@amutu.com
  2014-09-29 08:02 ` Re: BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off Michael Paquier <michael.paquier@gmail.com>
@ 2014-09-29 09:22   ` Jov <amutu@amutu.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Jov @ 2014-09-29 09:22 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: pgsql-bugs

I read the doc before I submit the bug
2014年9月29日 4:03 PM于 "Michael Paquier" <michael.paquier@gmail.com>写道:
>
>
>
> On Mon, Sep 29, 2014 at 4:45 PM, <amutu@amutu.com> wrote:
>>
>> from the doc,when synchronous_commit set to off or local,the commit will
not
>> wait the remote slave reveive data,so it is not asynchronous
replication.but I
>> find the pg_stat_replication wrongly report the sync_stat to sync.This
can
>
> This is not a bug, please refer to the documentation about
synchronous_commit:
>
http://www.postgresql.org/docs/devel/static/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT
>
> When synchronous_commit is set to off, local or remote_write, the master
node does not wait for the confirmation from the sync standby that the WAL
has been flushed to disk (for remote_write it waits for the write
confirmation), and the standby is still considered as sync, of course if
synchronous_standby_names is set.

I can't figure out this conclusion from the doc above.I appreciate it if
you point me more specifically.
> Regards,
> --
> Michael

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2014-09-29 09:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-09-29 07:45 BUG #11517: the pg_stat_replication.sync_stat show sync when synchronous_commit is set to be off amutu@amutu.com
2014-09-29 08:02 ` Michael Paquier <michael.paquier@gmail.com>
2014-09-29 09:22   ` Jov <amutu@amutu.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox