Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans
Date
Msg-id 20040823220150.S31879@megazone.bigpanda.com
Whole thread Raw
In response to Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans handling  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans handling  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, 24 Aug 2004, Christopher Kings-Lynne wrote:

> > Uh ... the interesting question is usually not "does this backend hold
> > any row locks", it is "is this row locked by any backends".  If the
> > latter question is not *exceedingly* cheap to answer, at least in the
> > normal case where the answer is no, you don't have a workable solution,
> > because you'll be adding nontrivial overhead to every row update.
>
> OK, what I mean is to know if a row is locked by any backend, why can't
> we just put a reference count of the number of locks on that row,
> instead of recording each backend separately?  Wouldn't that require a
> fixed amount of shared mem?

AFAICT you have to do something on top of that to allow deadlock
detection.  If transaction X has a shared row lock on A and is waiting on
a lock for me and I want to get an exclusive row lock on A, how do I
detect that it's a deadlock?


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: [COMMITTERS] pgsql-server: Rearrange pg_subtrans handling
Next
From: Christopher Kings-Lynne
Date:
Subject: AT TIME ZONE