From: | "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | <pgsql-hackers(at)postgreSQL(dot)org> |
Subject: | RE: [HACKERS] Potential vacuum bug? |
Date: | 2000-01-11 01:58:27 |
Message-ID: | 000101bf5bd7$5a2a96a0$2801007e@tpf.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> -----Original Message-----
> From: owner-pgsql-hackers(at)postgreSQL(dot)org
> [mailto:owner-pgsql-hackers(at)postgreSQL(dot)org]On Behalf Of Tom Lane
>
> While chasing the VACUUM problem reported by Stephen Birch, I noticed
> something that looks like a potential trouble spot. Vacuum's initial
> scan routine, vc_scanheap, runs through the table to mark tuples as
> known committed or known dead, if possible (consulting the transaction
> log for tuples not yet so marked). It does the right things as far as
> marking committed/dead if it sees a tuple marked HEAP_MOVED_OFF or
> HEAP_MOVED_IN, which could only be there if a prior VACUUM failed
> partway through. But it doesn't *clear* those bits. Seems to me that
> that will screw up the subsequent vc_rpfheap procedure --- in
> particular, leaving a HEAP_MOVED_IN flag set will cause vc_rpfheap to
> complain (correctly!) about 'HEAP_MOVED_IN not expected', whereas
> leaving HEAP_MOVED_OFF set will confuse vc_rpfheap because it will
> think it moved the tuple itself.
>
I'm for your change.
Anyway it's not good to hold useless flags unnecessarily.
However I could hardly find the case that would cause a trouble.
It may occur in the following rare cases though I'm not sure.
HEAP_MOVED_OFF and (neither HEAP_XMIN_COMMITTED nor
HEAP_XMIN_INVALID) and the tuple was recently delete/updated.
This means that the previous VACUUM couldn't remove the tuple
because old transactions were running then and moreover the
VACUUM half successed(i.e aborted between internal commit and
external commit). Now VACUUM marks this tuple as tupgone once
but would turn it off later if old transctions are still running.
Regards.
Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-01-11 02:25:51 | Re: [HACKERS] Changing oidvector length |
Previous Message | Bruce Momjian | 2000-01-11 01:25:14 | Re: [HACKERS] Changing oidvector length |