Is it possible that session lock is not released

From: T <kurt023(at)hotmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Is it possible that session lock is not released
Date: 2013-12-12 03:56:54
Message-ID: BAY173-W3774652D9D86835F8CBEBFE6DC0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I just found that ShutdownPostgres() only releases USER_LOCKMETHOD locks, so why not
release DEFAULT_LOCKMETHOD locks? Check if this is possible:
We are doing a CREATE INDEX CONCURRENTLY, and codes runs to

LockRelationIdForSession(&heaprelid, ShareUpdateExclusiveLock);

PopActiveSnapshot();
CommitTransactionCommand();

Now transaction goes to default state, then this backend is killed or some FATAL error happens,
AbortOutOfAnyTransaction() in ShutdownPostgres() will do nothing since transaction is in default
state, and session lock on heaprelid is still held after ShutdownPostgres(), so subsequent operations
could be blocked by this session lock.

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jayadevan 2013-12-12 03:57:25 Re: vacuuming - doubt
Previous Message Mike Christensen 2013-12-12 03:24:36 Npgsql - Where can I find Npgsql.NpgsqlServices