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>, "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 14:31:47
Message-ID: 1904087945.1280154.1427293907628.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:

> synchronous replication. When a transaction is received by the
> master before the slave is up and running, the transaction seems
> blocked forever on the backend.

This is not a bug. The promise made for synchronous replication is
that when a commit returns an indication of success, the
transaction has been persisted on at least two clusters. If you
don't want that promise yet, don't turn on synchronous replication
yet. If you want that guarantee but you want the primary to be
able to continue to commit transactions when there is a failure of
a synchronous replica, then provide more than one synchronous
replica.

There was discussion of supporting a "don't actually provide that
guarantee, but kinda try when it's responding fast enough", but
that was rejected as being so close to asynchronous replication as
to not really add any value. All it would do is stall the
successful return of a commit request without actually giving you
any stronger guarantee than asynchronous replication. Effectively,
any product that behaves that way is just giving you a false sense
of security. If you don't need the guarantee of a second copy of
the transaction having been persisted to a second cluster, use
asynchronous replication.

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-03-25 14:37:38 Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version
Previous Message smarvin 2015-03-25 14:05:22 BUG #12897: SQLDescribeColumn() and bit columns