Tighten up error recovery for fast-path locking.
authorRobert Haas <rhaas@postgresql.org>
Wed, 18 Apr 2012 15:17:30 +0000 (11:17 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 1 Jun 2012 12:32:36 +0000 (08:32 -0400)
commitf0504e60536135e1f27259cc90504a990de00d4c
tree042ecf345056407373d501737f5d65b131db01db
parent9e3b8a0e0330e4106bcbd42f4e27d7ac1fdb8688
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.
src/backend/access/transam/xact.c
src/backend/storage/lmgr/README
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/proc.c
src/backend/tcop/postgres.c
src/include/storage/lock.h
src/include/storage/proc.h