1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-22 23:02:54 +03:00

Fix incorrect decision about which lock to take.

Spotted by Tom Lane.
This commit is contained in:
Robert Haas 2016-02-21 17:06:41 +05:30
parent d91a4a6c85
commit 88aca5662d

View 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 */