pgsql: Fix two more bugs in fast-path relation locking.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix two more bugs in fast-path relation locking.
Date: 2012-05-30 20:23:36
Message-ID: E1SZpQe-0005oj-3W@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix two more bugs in fast-path relation locking.

First, the previous code failed to account for the fact that, during Hot
Standby operation, the startup process takes AccessExclusiveLocks on
relations without setting MyDatabaseId. This resulted in fast path
strong lock counts failing to be incremented with the startup process
took locks, which in turn allowed conflicting lock requests to succeed
when they should not have. Report by Erik Rijkers, diagnosis by Heikki
Linnakangas.

Second, LockReleaseAll() failed to honor the allLocks and lockmethodid
restrictions with respect to fast-path locks. It's not clear to me
whether this produces any user-visible breakage at the moment, but it's
certainly wrong. Rearrange order of operations in LockReleaseAll to fix.
Noted by Tom Lane.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/07ab1383e3be9e6f368e2ceb11bf7697d88260f9

Modified Files
--------------
src/backend/storage/lmgr/lock.c | 235 ++++++++++++++++++++-------------------
1 files changed, 121 insertions(+), 114 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-05-30 23:59:30 pgsql: Expand the allowed range of timezone offsets to +/-15:59:59 from
Previous Message Fujii Masao 2012-05-30 16:17:04 Re: Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.