liquid_feedback_core
diff update/core-update.v2.0.11-v2.1.0.sql @ 299:dbd237d86a8a
merge: In function "lock_issue"("issue"."id"): Instead of accquiring a table-level EXCLUSIVE lock, use a table-level SHARE lock in combination with row-level SHARE locks
author | jbe |
---|---|
date | Tue Sep 25 13:37:27 2012 +0200 (2012-09-25) |
parents | 779ba19a07df |
children | 7cad34b945ac |
line diff
1.1 --- a/update/core-update.v2.0.11-v2.1.0.sql Tue Sep 25 02:32:51 2012 +0200 1.2 +++ b/update/core-update.v2.0.11-v2.1.0.sql Tue Sep 25 13:37:27 2012 +0200 1.3 @@ -431,7 +431,10 @@ 1.4 -- is changed, which could affect calculation of snapshots or 1.5 -- counting of votes. Table "delegation" must be table-level-locked, 1.6 -- as it also contains issue- and global-scope delegations. 1.7 - LOCK TABLE "member" IN EXCLUSIVE MODE; -- exclusive avoids deadlocks 1.8 + LOCK TABLE "member" IN SHARE MODE; 1.9 + -- NOTE: As we later cause implicit row-level share locks on many 1.10 + -- active members, we lock them right here to avoid deadlocks 1.11 + PERFORM NULL FROM "member" WHERE "active" FOR SHARE; 1.12 LOCK TABLE "privilege" IN SHARE MODE; 1.13 LOCK TABLE "membership" IN SHARE MODE; 1.14 LOCK TABLE "policy" IN SHARE MODE;