Tighten up error recovery for fast-path locking.
Robert Haas <rhaas@postgresql.org>
Tighten up error recovery for fast-path locking. The previous code could cause a backend crash after BEGIN; SAVEPOINT a; LOCK TABLE foo (interrupted by ^C or statement timeout); ROLLBACK TO SAVEPOINT a; LOCK TABLE foo, and might have leaked strong-lock counts in other situations. Report by Zoltán Böszörményi; patch review by Jeff Davis.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/xact.c | modified | +2 −2 |
| src/backend/storage/lmgr/lock.c | modified | +75 −16 |
| src/backend/storage/lmgr/proc.c | modified | +11 −8 |
| src/backend/storage/lmgr/README | modified | +1 −1 |
| src/backend/tcop/postgres.c | modified | +3 −3 |
| src/include/storage/lock.h | modified | +1 −0 |
| src/include/storage/proc.h | modified | +1 −1 |