Re: Vacuum/visibility is busted

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Vacuum/visibility is busted
Date: 2013-02-07 09:44:52
Message-ID: CABOikdPaSrdG9S9zJD-U+wRxHgJ1hgO-m=YAD4sJPwknLxjW9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 7, 2013 at 2:25 PM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com> wrote:

>
> Will look more into it, but thought this might be useful for others to
> spot the problem.
>

And here is some more forensic info about one of the pages having
duplicate tuples.

jjanes=# select *, xmin, xmax, ctid from foo where index IN (select
index from foo group by index having count(*) > 1 ORDER by index)
ORDER by index LIMIT 3;
index | count | xmin | xmax | ctid
-------+-------+------------+------+-----------
219 | 353 | 2100345903 | 0 | (150,98)
219 | 354 | 2100346051 | 0 | (150,101)
219 | 464 | 2101601086 | 0 | (150,126)
(3 rows)

jjanes=# select * from page_header(get_raw_page('foo',150));
lsn | tli | flags | lower | upper | special | pagesize |
version | prune_xid
-------------+-----+-------+-------+-------+---------+----------+---------+-----------
4C/52081968 | 1 | 5 | 1016 | 6304 | 8192 | 8192 |
4 | 0
(1 row)

jjanes=# select * from heap_page_items(get_raw_page('foo',150)) WHERE
lp IN (98, 101, 126);
lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_field3 |
t_ctid | t_infomask2 | t_infomask | t_hoff | t_bits | t_oid
-----+--------+----------+--------+------------+--------+----------+-----------+-------------+------------+--------+--------+-------
98 | 7968 | 1 | 32 | 2100345903 | 0 | 0 |
(150,101) | 32770 | 10496 | 24 | |
101 | 7904 | 1 | 32 | 2100346051 | 0 | 0 |
(150,101) | 32770 | 10496 | 24 | |
126 | 7040 | 1 | 32 | 2101601086 | 0 | 0 |
(150,126) | 32770 | 10496 | 24 | |
(3 rows)

So every duplicate tuple has the same flags set:

HEAP_XMAX_INVALID
HEAP_XMIN_COMMITED
HEAP_UPDATED
HEAP_ONLY_TUPLE

The first two duplicates are chained by the ctid chain, but the last
one looks independent. More later.

Thanks,
Pavan
--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-02-07 09:47:56 Re: [COMMITTERS] pgsql: Fast promote mode skips checkpoint at end of recovery.
Previous Message Heikki Linnakangas 2013-02-07 09:04:17 Re: [COMMITTERS] pgsql: Fast promote mode skips checkpoint at end of recovery.