Skip site navigation (1) Skip section navigation (2)

RE: [HACKERS] Concurrent VACUUM: first results

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Vadim Mikheev" <vadim(at)krs(dot)ru>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: [HACKERS] Concurrent VACUUM: first results
Date: 1999-11-26 22:48:05
Message-ID: NDBBIJLOILGIKBGDINDFAECHCBAA.Inoue@tpf.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
>
> Hiroshi Inoue wrote:
> >
> > > Vadim Mikheev <vadim(at)krs(dot)ru> writes:
> > > >>>> * We have to commit our tuple' movings before we'll truncate
> > > >>>> * relation, but we shouldn't lose our locks. And so - quick hack:
> > >
> > > > ... or moved tuples may be lost in the case of DB/OS crash etc
> > > >     that may occur after truncation but before commit...
> > >
> > > I wonder whether there isn't a cleaner way to do this.  What about
> > > removing this early commit, and doing everything else the way that
> > > VACUUM does it, except that the physical truncate of the relation
> > > file happens *after* the commit at the end of vc_vacone?
> > >
> >
> > I think there exists another reason.
> > We couldn't delete index tuples for deleted but not yet committed
> > heap tuples.
>
> You're right!
> I just don't remember all reasons why I did as it's done -:))
>
> > If we could start another transaction without releasing exclusive
> > lock for the target relation,it would be better.
>
> So. What's problem?! Start it! Commit "moving" xid, get new xid and go!
>

After a thought,I remembered that members of xidHash hold xids.
Must I replace them by new xid ?
Seems it isn't a cleaner way than current.

There's another way.
We could commit and start Transaction after truncation and
before vc_updstats().
One of the problem is that cache invalidation is issued in vc_
updstats().
It is preferable that cache invalidation is called immedately
after/before truncation,isn't it ?
Any other problems ?


BTW how(or what) would WAL do when vacuum fails after
TransactionIdCommit() ?

Regards.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp


In response to

pgsql-hackers by date

Next:From: Jan WieckDate: 1999-11-26 23:22:12
Subject: Re: [HACKERS] substring extraction
Previous:From: Lamar OwenDate: 1999-11-26 21:51:55
Subject: Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group