Re: Re: PD_ALL_VISIBLE flag was incorrectly set happend during repeatable vacuum

From: daveg <daveg(at)sonic(dot)net>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: PD_ALL_VISIBLE flag was incorrectly set happend during repeatable vacuum
Date: 2011-03-07 23:53:40
Message-ID: 20110307235340.GA21941@sonic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Fri, Mar 04, 2011 at 05:52:29PM +0200, Heikki Linnakangas wrote:
> Hmm, if these all came from the same database, then it looks OldestXmin
> has moved backwards. That would explain the warnings. First one vacuum
> determines that all the tuples are visible to everyone and sets the
> flag. Then another vacuum runs with an older OldestXmin, and determines
> that there's a tuple on the page with an xmin that is not yet visible to
> everyone, hence it thinks that the flag should not have been set yet.
>
> Looking at the code, I don't see how that situation could arise, though.
> The value calculated by GetOldestXmin() should never move backwards. And
> GetOldestXmin() is called in lazy_vacuum_rel(), after it has acquired a
> lock on the table, which should protect from a race condition where two
> vacuums could run on the table one after another, in a way where the
> later vacuum runs with an OldestXmin calculated before the first vacuum.
>
> Hmm, fiddling with vacuum_defer_cleanup_age on the fly could cause that,
> though. You don't do that, do you?

No.

I've updated the patch to collect db and schema and added Merlins patch as
well and run it for a while. The attached log is all the debug messages
for pg_statistic page 333 from one database. I've also attached the two
most recent page images for that particular page, the last digits in the
filename are the hour and minute of when the page was saved.

What else can I be doing to help figure this out?

Thanks

-dg

--
David Gould daveg(at)sonic(dot)net 510 536 1443 510 282 0869
If simplicity worked, the world would be overrun with insects.

Attachment Content-Type Size
pageimage_c57_pg_catalog_pg_statistic_333.0127 application/octet-stream 8.0 KB
pageimage_c57_pg_catalog_pg_statistic_333.0701 application/octet-stream 8.0 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Greg Stark 2011-03-08 02:07:53 Re: PD_ALL_VISIBLE flag was incorrectly set happend during repeatable vacuum
Previous Message raghu ram 2011-03-07 18:06:56 Re: psql causing a error

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-03-08 00:15:28 Re: Theory of operation of collation patch
Previous Message Devrim GÜNDÜZ 2011-03-07 23:12:56 Re: Alpha4 release blockers (was Re: wrapping up this CommitFest)