Re: problems with table corruption continued - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Re: problems with table corruption continued
Date
Msg-id 3C1FDD2A.EC4A8B51@tpf.co.jp
Whole thread Raw
In response to Re: problems with table corruption continued  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Responses Re: problems with table corruption continued  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 
> "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> > Should the change be TransactionIdIsInProgress(tuple->t_cmin) ?
> 
> I'd be willing to do
>         if (tuple->t_cmin is my XID)
>                 do something;
>         Assert(!TransactionIdIsInProgress(tuple->t_cmin));
> if that makes you feel better. 

It's useless in hard to reproduce cases. 
I've thought but given up many times to propose this
change and my decision seems to have been right because
I see only *Assert* even after this issue.

> But anything that's scanning
> a table exclusive-locked by another transaction is broken.
> (BTW: contrib/pgstattuple is thus broken.  Will fix.)

It seems dangerous to me to rely only on developers'
carefulness. There are some places where relations
are opened with NoLock. We had better change them.
I once examined them but AFAIR there are few cases
when they are really opened with NoLock. In most
cases they are already opened previously with other
lock modes. I don't remember well if there was a
really dangerous(scan an relation opened with NoLock)
place.

regards,
Hiroshi Inoue


pgsql-hackers by date:

Previous
From: Thomas Swan
Date:
Subject: Re: Thoughts on the location of configuration files
Next
From: "Andrew G. Hammond"
Date:
Subject: Re: Explicit config patch 7.2B4