Re: CIC and deadlocks - Mailing list pgsql-hackers

From Pavan Deolasee
Subject Re: CIC and deadlocks
Date
Msg-id 2e78013d0703311121u43dacd82x8a7bc7b537798da9@mail.gmail.com
Whole thread Raw
In response to Re: CIC and deadlocks  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CIC and deadlocks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 3/31/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Hmm ... only if it's already set inVacuum true ... there's a window
where it has not.

I wonder whether we could change CIC so that the "reference
snapshot" lists only transactions that are running and have already
determined their serializable snapshot (ie, have set proc->xmin).
Xacts that haven't yet done that can be ignored because they couldn't
possibly see the dead tuples we're worried about, no?

Yes, it may work. Do we need to take some extra care because
proc-xmin is set while holding SHARED lock on proc array ?
 

Then we could rearrange the order of operations in vacuum_rel so
that we lock the target rel before we acquire a snapshot.  Then
a vacuum waiting for the CIC cannot cause a deadlock.

We may need to do the same in analyze_rel.


Thanks,
Pavan

--

EnterpriseDB     http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Oracle indemnifies PostgreSQL on its patents
Next
From: Tom Lane
Date:
Subject: Re: Oracle indemnifies PostgreSQL on its patents