Re: "no-slave yet" early CREATE TABLE transaction gets blocked when synchronous replication

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Sékine Coulibaly <scoulibaly(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: "no-slave yet" early CREATE TABLE transaction gets blocked when synchronous replication
Date: 2015-03-25 15:41:10
Message-ID: 1746945482.1336595.1427298070295.JavaMail.yahoo@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Sékine Coulibaly <scoulibaly(at)gmail(dot)com> wrote:

> I indeed want the security brought by synchronous replication.
> Having a commit no to return as long as the replica is not
> up-and-streaming is what I expect and perfectly fits my needs. It
> is perfectly right in my use case for the master to wait for the
> replica as long as necessary. Asynchronous replication is
> definitely not what I want.
>
> My concern here is that, although the slave is back, the pending
> commit is not performed on the master side.

I apologize for misunderstanding what you were experiencing.

> I'd expect all ongoing and blocking commits to be unblocked as
> soon as the slave pops in.

Indeed they should.

> Since the master and slave are synchronous after the slave is
> back, what's the point in holding a transaction forever in the
> master's backend ?

I know that a number of bugs for this sort of edge condition have
been fixed since 9.2.4 was release (on 2013-04-04). I strongly
recommend that you apply the latest bug-fix roll-up for the 9.2
branch, which is currently 9.2.10.

http://www.postgresql.org/support/versioning/

If you still see such behavior with the most recently released bug
fixes, please post again, attaching the configuration files and
showing log entries (from both clusters) from around the time the
slave is brought up.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message jgpedro 2015-03-25 15:48:12 BUG #12898: Failure loading materialized view with pg_restore
Previous Message Sékine Coulibaly 2015-03-25 15:06:17 Re: "no-slave yet" early CREATE TABLE transaction gets blocked when synchronous replication