Re: race condition in sync rep - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: race condition in sync rep
Date
Msg-id AANLkTimCPyy401nyqzLwD5pX9kj2763JD1yaYvu13W-H@mail.gmail.com
Whole thread Raw
In response to Re: race condition in sync rep  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: race condition in sync rep
List pgsql-hackers
On Sat, Mar 26, 2011 at 5:51 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Sat, Mar 26, 2011 at 12:41 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> Is it? Sync rep requires fsync on the standby. If you then explicitly
>> turn off fsync on the standby then it has a performance impact, as
>> documented.
>
> Actually, it doesn't, now that you fixed this.  Before:
>
> [rhaas@office ~]$ pgbench -T 10
> starting vacuum...end.
> transaction type: TPC-B (sort of)
> scaling factor: 25
> query mode: simple
> number of clients: 1
> number of threads: 1
> duration: 10 s
> number of transactions actually processed: 27
> tps = 0.099386 (including connections establishing)
> tps = 0.099389 (excluding connections establishing)
> [rhaas@office ~]$ pgbench -T 10
> starting vacuum...end.
> transaction type: TPC-B (sort of)
> scaling factor: 25
> query mode: simple
> number of clients: 1
> number of threads: 1
> duration: 10 s
> number of transactions actually processed: 425
> tps = 42.442185 (including connections establishing)
> tps = 42.468972 (excluding connections establishing)
>
> The first one - run with code from a few weeks ago - hung up on the
> 27th transaction and was stuck there until the next checkpoint
> completed.  The second one was run with the latest code and no longer
> hangs - and in fact it's now faster than running with fsync=on,
> exactly as one would expect.  Or at least as *I* expected.

Are the master and standby on same system or are they separated by a network?

I'm surprised that a network roundtrip takes less time than the
backend takes to mark clog and then queue for the SyncRepLock.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: DO hint update?
Next
From: Simon Riggs
Date:
Subject: Re: Lock problem with autovacuum truncating heap