Re: [HACKERS] Open 6.5 items

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, t-ishii(at)sra(dot)co(dot)jp, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Open 6.5 items
Date: 1999-06-03 13:44:58
Message-ID: 375686DA.B584296E@krs.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hiroshi Inoue wrote:
>
> However,when I did vacuum while testing I got the following error
> message.
> ERROR: Child itemid marked as unused
>
> TransactionId-s of tuples in update chain may be out of order.

1. Fix and explanation in xact.c:CommitTransaction():

RecordTransactionCommit();

/*
* Let others know about no transaction in progress by me.
* Note that this must be done _before_ releasing locks we hold
* and SpinAcquire(ShmemIndexLock) is required - or bad (too high)
* XmaxRecent value might be used by vacuum: UPDATE with xid 0 is
* blocked by xid 1' UPDATE, xid 1 is doing commit while xid 2
* gets snapshot - if xid 2' GetSnapshotData sees xid 1 as running
* then it must see xid 0 as running as well or XmaxRecent = 1
* might be used by concurrent vacuum causing
* ERROR: Child itemid marked as unused
* This bug was reported by Hiroshi Inoue and I was able to reproduce
* it with 3 sessions and gdb. - vadim 06/03/99
*/
if (MyProc != (PROC *) NULL)
{
SpinAcquire(ShmemIndexLock);
MyProc->xid = InvalidTransactionId;
MyProc->xmin = InvalidTransactionId;
SpinRelease(ShmemIndexLock);
}

2. It was possible to get two versions of the same row from
select. Fixed by moving MyProc->xid assignment from
StartTransaction() inside GetNewTransactionId().

Thanks, Hiroshi! And please run your tests - I used just
3 sessions and gdb.

Vadim

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-06-03 14:13:15 Re: [HACKERS] Re: Freezing docs for v6.5
Previous Message Dmitry Samersoff 1999-06-03 12:23:01 Re: [HACKERS] PID of backend