RE: Vacuum only with 20% old tuples

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Zeugswetter Andreas SB" <ZeugswetterA(at)wien(dot)spardat(dot)at>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: RE: Vacuum only with 20% old tuples
Date: 2000-07-25 10:16:01
Message-ID: 001501bff621$5578d880$2801007e@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Zeugswetter Andreas SB [mailto:ZeugswetterA(at)wien(dot)spardat(dot)at]
>
> > > It does not postpone anything. WAL only logs what it does:
> > >
> > > 1. log i now start to rename file
> > > 2. rename file
> >
> > How do we log *rename* ?
>
> No, step 2 was meant to do the actual rename.
> You log before and after the actual rename.
>
> > What I've meant by *rename* is to replace an existent table
> > file by a (e.g. work temp) file. So the old table file would
> > vanish by renaming.
>
> you need to rename the old file first then the new file
>
> > How to save the content for rollback ?
>
> with rename of old file
>

OK,I see. Your idea seems to be close to Vadim's *relink*.
However it isn't clear if *relink* has no problem.
In my test case on cygwin port ,*relink* doesn't work well.
*relink* caused an error if concurrent backends open the
*relink*ing table.

> >
> > > >
> > > > No there's a significant difference between the failure
> > of 'delete'
> > > > and that of 'rename'. We would have no consistency problem even
> > > > though 'delete' fails and wouldn't have to stop postmaster. But we
> > > > wouldn't be able to see the renamed relation in case of 'rename'
> > > > failure and an excellent(??) dba would have to recover the
> > > > inconsistency.
> > >
> > > The dba only fixes the underlying problem, like filesystem
> > > mounted readonly
> > > or wrong permissions on directory. He then simply starts
> > the postmaster
> > > again,
> > > the rollforward with rename will then succeed.
> > >
> >
> > Mustn't a dba be there to restart the postmaster when *rename*
> > fails ? We don't need a dba even when *delete* fails after commit.
>
> The dba needs to clean up unused file space later,
> which leaves the problem for the dba to decide which file is needed
> and what not (quite difficult with an oid filename).
>

Yes,I don't want a dba to deal with such an unrelible recovery.
Probably vacuum must be wise enough to remove unremoved
table files before removing dead pg_class tuples.

Regards.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas SB 2000-07-25 10:16:50 AW: Vacuum only with 20% old tuples
Previous Message Vince Vielhaber 2000-07-25 10:05:49 pg_shadow