最近在程序日志中发现有死锁,具体错误信息如下:
Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected
Detail: Process 17662 waits for ShareLock on transaction 11042283; blocked by process 17659.
Process 17659 waits for ShareLock on transaction 11042282; blocked by process 17662.
发现两篇关于postgresql死锁和排查死锁的文章。
https://rcoh.svbtle.com/postgres-unique-constraints-can-cause-deadlock
http://www.moioli.net/progetti/postgres-deadlocks-debugging-guidelines/
了解了原因后还需要结合业务具体排查。