Re: Summary and Plan for Hot Standby - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Summary and Plan for Hot Standby
Date
Msg-id 1259132046.27757.11288.camel@ebony
Whole thread Raw
In response to Re: Summary and Plan for Hot Standby  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Thu, 2009-11-19 at 10:13 +0200, Heikki Linnakangas wrote:

> At backend start, we normally take
> RowExclusiveLock on the database in postinit.c, but you had to modify
> to acquire AccessShareLock instead in standby mode.

The consensus from earlier discussion was that allowing users to grab
RowExclusiveLock during read only transactions was not a problem, since
it allowed PREPARE. So there seems no need to prevent it in other
places.

So I suggest removing most of the changes in postinit.c, and changing
the lock restrictions in lock.c to be

+    if (RecoveryInProgress() &&
+        (locktag->locktag_type == LOCKTAG_OBJECT ||
+         locktag->locktag_type == LOCKTAG_RELATION ) &&
+        lockmode > RowExclusiveLock)
then ERROR

lockcmds.c would also be changed to allow LOCK TABLE of up to
RowExclusiveLock.

-- Simon Riggs           www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Architecture of walreceiver (Streaming Replication)
Next
From: Simon Riggs
Date:
Subject: LockDatabaseObject()