Re: BUG #17591: elog(ERROR) cause SharedSnapshotLock deadlock

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: ma100(at)hotmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17591: elog(ERROR) cause SharedSnapshotLock deadlock
Date: 2022-08-22 07:45:11
Message-ID: 46726dc2-ca8c-426e-bb4e-cfa47ce48d9e@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

Didn’t see any bugs here, it report an error and the transaction will end and release all resources.

Regards,
Zhang Mingli
On Aug 22, 2022, 14:58 +0800, PG Bug reporting form <noreply(at)postgresql(dot)org>, wrote:
> The following bug has been logged on the website:
>
> Bug reference: 17591
> Logged by: ma liangzhu
> Email address: ma100(at)hotmail(dot)com
> PostgreSQL version: 14.5
> Operating system: centos7
> Description:
>
> in lock.c, we can see code Release lock before return , e.g.
>
> ```c
> 996: LockAcquireExtended
> {
> LWLockAcquire(partitionLock, LW_EXCLUSIVE);
>
> proclock = SetupLockInTable( );
> if (!proclock)
> {
> LWLockRelease(partitionLock); --- Release lock before return
> ereport(ERROR,)
> }
> }
> ```
>
> bug we can see some code doesn't release the lock. Does it may cause
> deadlock?
>
> ```c
> LockRelease()
> {
> LWLockAcquire(partitionLock, LW_EXCLUSIVE);
>
> lock = locallock->lock;
> if (!lock)
> {
> lock = (LOCK *) hash_search_with_hash_value( );
> if (!lock)
> 2126: elog(ERROR, "failed to re-find shared lock object"); -- exit
> without release
> }
> ```
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message John Naylor 2022-08-22 10:52:29 Re: fetching bytea (blob) data of 850 MB from psql client failed
Previous Message jitesh tiwari 2022-08-22 07:14:17 fetching bytea (blob) data of 850 MB from psql client failed