On Thu, Feb 7, 2013 at 2:25 PM, Pavan Deolasee <pavan.deola...@gmail.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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to