Fix pg_blocking_pids() for relation extension locks.

pg_blocking_pids() assumes that members of the same lock group
never block each other, but that hasn't been true for relation
extension locks since v13.  This commit teaches the function to
report lock group members as blockers for relation extension locks.
Since parallel workers are reported with their leader's PID, the
result may now include the blocked session's own PID.

Oversight in commit 85f6b49c2c.

Author: Bertrand Drouvot <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Kirill Reshke <[email protected]>
Reviewed-by: Shihao Zhong <[email protected]>
Discussion: https://postgr.es/m/apTpV8h%2BCYHf%2B1PJ%40bdtpg
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c0df269c5b9d33568ed35a7bfc92bcd967ed4a56

Modified Files
--------------
doc/src/sgml/func.sgml            | 21 ++++++++++++++-------
src/backend/utils/adt/lockfuncs.c | 10 ++++++++--
2 files changed, 22 insertions(+), 9 deletions(-)

Reply via email to