Re: synchronous_standby_names with '*' - Mailing list pgsql-general

From Fujii Masao
Subject Re: synchronous_standby_names with '*'
Date
Msg-id CAHGQGwESuFKYXCUeYmxtRU31H-iwQSUAQ8Q1yOn-wQnWOzd8bA@mail.gmail.com
Whole thread Raw
In response to synchronous_standby_names with '*'  (alexondi <alexondi@rambler.ru>)
Responses Re: synchronous_standby_names with '*'
List pgsql-general
On Fri, Aug 19, 2011 at 7:06 PM, alexondi <alexondi@rambler.ru> wrote:
> Hi!
> I try create master for replication and in his config I set
> synchronous_standby_names = '*'
> so I can connect with other slave's (name of this slave I don't know at this
> moment)
> But if I try execute some commands (I hung on 'create database') my program
> hang and after some time I see
> in processes
> ... create database waiting for 0/XXXXXX
> and when I strace to wal I see
> ...
> select ... timeout
> getpid()
> select ... timeout
> getpid()
> ...
> and so on.
> What so '*' mean in this GUC?

Setting synchronous_standby_names forces the master to perform
synchronous replication. If synchronous_commit is set to 'on',
all the transactions must wait for their WAL to be replicated to
the standby. Since you set synchronous_standby_names to '*',
"create database" hanged, i.e., was waiting for its WAL to be
replicated to the standby.

Only standby whose application_name matches synchronous_standby_names
can run as synchronous standby. '*' matches any application_name, so
'*' means that any standby can run as synchronous one.

Regards,

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

pgsql-general by date:

Previous
From: alexondi
Date:
Subject: synchronous_standby_names with '*'
Next
From: alexondi
Date:
Subject: Re: synchronous_standby_names with '*'