Commit 88aca566 authored by Robert Haas's avatar Robert Haas

Fix incorrect decision about which lock to take.

Spotted by Tom Lane.
parent d91a4a6c
...@@ -1805,7 +1805,7 @@ BecomeLockGroupMember(PGPROC *leader, int pid) ...@@ -1805,7 +1805,7 @@ BecomeLockGroupMember(PGPROC *leader, int pid)
* initialization and never change thereafter; so we will acquire the * initialization and never change thereafter; so we will acquire the
* correct lock even if the leader PGPROC is in process of being recycled. * 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); LWLockAcquire(leader_lwlock, LW_EXCLUSIVE);
/* Try to join the group */ /* Try to join the group */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment