Re: CIC and deadlocks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CIC and deadlocks
Date: 2007-03-31 19:00:40
Message-ID: 7574.1175367640@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

"Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com> writes:
> Yes, it may work. Do we need to take some extra care because
> proc-xmin is set while holding SHARED lock on proc array ?

Good point. I'm envisioning a procarray.c function along the
lines of
bool TransactionHasSnapshot(xid)
which returns true if the xid is currently listed in PGPROC
and has a nonzero xmin. CIC's cleanup wait loop would check
this and ignore the xid if it returns false. Your point means
that this function would have to take exclusive not shared lock
while scanning the procarray, which is kind of annoying, but
it seems not fatal since CIC isn't done all that frequently.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Luke Lonergan 2007-03-31 19:33:45 Re: Oracle indemnifies PostgreSQL on its patents
Previous Message Tom Lane 2007-03-31 18:54:51 Re: Oracle indemnifies PostgreSQL on its patents

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2007-03-31 19:06:25 Re: Current enums patch
Previous Message Pavan Deolasee 2007-03-31 18:21:58 Re: CIC and deadlocks