Re: Hot Standby 0.2.1 - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: Hot Standby 0.2.1
Date
Msg-id f67928030909211942h41c330cak8201168100142a22@mail.gmail.com
Whole thread Raw
In response to Hot Standby 0.2.1  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Hot Standby 0.2.1
List pgsql-hackers
On Tue, Sep 15, 2009 at 2:41 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
>
> OK, here is the latest version of the Hot Standby patchset. This is
> about version 30+ by now, but we should regard this as 0.2.1
> Patch against CVS HEAD (now): clean apply, compile, no known bugs.
>
> OVERVIEW
>
> You can download PDF versions of the fine manual is here
> http://wiki.postgresql.org/images/0/01/Hot_Standby_main.pdf


From this doc:

"In recovery, transactions will not be permitted to take any lock
higher other than
AccessShareLock or AccessExclusiveLock. In addition, transactions may never
assign a TransactionId and may never write WAL. The LOCK TABLE command by
default applies an AccessExclusiveLock. Any LOCK TABLE command that runs on
the standby and requests a specific lock type other than AccessShareLock will be
rejected."

The first sentence seems to say that clients on the stand-by can take
ACCESS EXCLUSIVE, while the last sentence seems to say that they
cannot do so.

I did a little experiment on a hot standby instance.  I expected that
either I would be denied the lock altogether, or the lock would cause
WAL replay to be paused until either I committed or was forcibly
canceled.  But neither happened, I was granted the lock but WAL replay
continued anyway.

jjanes=# begin;
BEGIN
jjanes=# lock table pgbench_history in access exclusive mode;
LOCK TABLE
jjanes=# select count(*) from pgbench_history;
 count
--------
 519104
(1 row)

jjanes=# select count(*) from pgbench_history;
 count
--------
 527814
(1 row)

Is this the expected behavior?

Thanks,

Jeff


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Using results from INSERT ... RETURNING
Next
From: Gurjeet Singh
Date:
Subject: Re: TODO item: Allow more complex user/database default GUC settings