Setup error context callback for transaction lock waits
Alvaro Herrera <alvherre@alvh.no-ip.org>
Setup error context callback for transaction lock waits With this in place, a session blocking behind another one because of tuple locks will get a context line mentioning the relation name, tuple TID, and operation being done on tuple. For example: LOG: process 11367 still waiting for ShareLock on transaction 717 after 1000.108 ms DETAIL: Process holding the lock: 11366. Wait queue: 11367. CONTEXT: while updating tuple (0,2) in relation "foo" STATEMENT: UPDATE foo SET value = 3; Most usefully, the new line is displayed by log entries due to log_lock_waits, although of course it will be printed by any other log message as well. Author: Christian Kruse, some tweaks by Álvaro Herrera Reviewed-by: Amit Kapila, Andres Freund, Tom Lane, Robert Haas
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +56 −24 |
| src/backend/access/nbtree/nbtinsert.c | modified | +1 −1 |
| src/backend/catalog/index.c | modified | +6 −2 |
| src/backend/executor/execMain.c | modified | +3 −1 |
| src/backend/executor/execUtils.c | modified | +2 −1 |
| src/backend/replication/logical/snapbuild.c | modified | +1 −1 |
| src/backend/storage/lmgr/lmgr.c | modified | +100 −2 |
| src/include/storage/lmgr.h | modified | +16 −1 |
| src/nls-global.mk | modified | +4 −1 |