Fix incorrect decision about which lock to take.
authorRobert Haas <rhaas@postgresql.org>
Sun, 21 Feb 2016 11:36:41 +0000 (17:06 +0530)
committerRobert Haas <rhaas@postgresql.org>
Sun, 21 Feb 2016 11:36:41 +0000 (17:06 +0530)
Spotted by Tom Lane.

src/backend/storage/lmgr/proc.c

index 641ef1182b8afd84becf670aab81ab7ea908970f..114fba0d384aa556e8a0de43e97da706e79cf035 100644 (file)
@@ -1805,7 +1805,7 @@ BecomeLockGroupMember(PGPROC *leader, int pid)
         * initialization and never change thereafter; so we will acquire the
         * correct lock even if the leader PGPROC is in process of being recycled.
         */
-       leader_lwlock = LockHashPartitionLockByProc(MyProc);
+       leader_lwlock = LockHashPartitionLockByProc(leader);
        LWLockAcquire(leader_lwlock, LW_EXCLUSIVE);
 
        /* Try to join the group */