Is it possible that session lock is not released - Mailing list pgsql-general

From T
Subject Is it possible that session lock is not released
Date
Msg-id BAY173-W3774652D9D86835F8CBEBFE6DC0@phx.gbl
Whole thread Raw
Responses Re: Is it possible that session lock is not released  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.

pgsql-general by date:

Previous
From: Mike Christensen
Date:
Subject: Npgsql - Where can I find Npgsql.NpgsqlServices
Next
From: Jayadevan
Date:
Subject: Re: vacuuming - doubt