Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Mahendra Singh Thalor <mahi6run@gmail.com>,
Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>,
Masahiko Sawada <masahiko.sawada@2ndquadrant.com>, Masahiko Sawada <sawada.mshk@gmail.com>,
Michael Paquier <michael@paquier.xyz>, Mithun Cy <mithun.cy@enterprisedb.com>,
Thomas Munro <thomas.munro@enterprisedb.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-03-06T04:17:41Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow page lock to conflict among parallel group members.
- 3ba59ccc896e 13.0 landed
-
Allow relation extension lock to conflict among parallel group members.
- 85f6b49c2c53 13.0 landed
-
Add assert to ensure that page locks don't participate in deadlock cycle.
- 72e78d831ab5 13.0 landed
-
Assert that we don't acquire a heavyweight lock on another object after
- 15ef6ff4b985 13.0 landed
-
Fix unsafe usage of strerror(errno) within ereport().
- 81256cd05f07 11.0 cited
On Thu, Mar 5, 2020 at 1:54 PM Dilip Kumar <dilipbalaut@gmail.com> wrote: > > On Thu, Mar 5, 2020 at 12:15 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > > > > > 5. I have also tried to think of another way to check if we already > > hold lock type LOCKTAG_RELATION_EXTEND, but couldn't come up with a > > cheaper way than this. Basically, I think if we traverse the > > MyProc->myProcLocks queue, we will get this information, but that > > doesn't seem much cheaper than this. > > I think we can maintain a flag (rel_extlock_held). And, we can set > that true in LockRelationForExtension, > ConditionalLockRelationForExtension functions and we can reset it in > UnlockRelationForExtension or in the error path e.g. LockReleaseAll. > I think if we reset it in LockReleaseAll during the error path, then we need to find a way to reset it during LockReleaseCurrentOwner as that is called during Subtransaction Abort which can be tricky as we don't know if it belongs to the current owner. How about resetting in Abort(Sub)Transaction and CommitTransaction after we release locks via ResourceOwnerRelease. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com