Skip site navigation (1) Skip section navigation (2)

Re: Synchronous commit not... synchronous?

From: David Fetter <david(at)fetter(dot)org>
To: Peter van Hardenberg <pvh(at)pvh(dot)ca>
Cc: "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Synchronous commit not... synchronous?
Date: 2012-11-01 04:03:03
Message-ID: (view raw or whole thread)
Lists: pgsql-hackers
On Wed, Oct 31, 2012 at 06:39:20PM -0700, Peter van Hardenberg wrote:
> This was rather surprising - my synchronous commit was... not
> cancelled.  Is this expected behaviour?

I believe it is.

Does the following do the right thing?

SET synchronous_commit='on';
INSERT INTO data VALUES ('baz');

Oh, and how did you get that cancel in?

> d5r5fdj6u5ieml=> begin;
> d5r5fdj6u5ieml=> set synchronous_commit = 'on';
> d5r5fdj6u5ieml=> insert into data values ('baz');
> INSERT 0 1
> d5r5fdj6u5ieml=> commit;
> ^CCancel request sent
> WARNING:  canceling wait for synchronous replication due to user request
> DETAIL:  The transaction has already committed locally, but might not have
> been replicated to the standby.
> d5r5fdj6u5ieml=> select * from data;
>  foo
> -----
>  bar
>  baz
> (2 rows)
> d5r5fdj6u5ieml=> rollback;
> NOTICE:  there is no transaction in progress
> d5r5fdj6u5ieml=>
> -- 
> Peter van Hardenberg
> San Francisco, California
> "Everything was beautiful, and nothing hurt." -- Kurt Vonnegut

David Fetter <david(at)fetter(dot)org>
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://

Remember to vote!
Consider donating to Postgres:

In response to


pgsql-hackers by date

Next:From: Peter EisentrautDate: 2012-11-01 04:05:33
Subject: Re: [COMMITTERS] pgsql: Preserve intermediate .c files in coverage mode
Previous:From: Amit kapilaDate: 2012-11-01 04:00:05
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group