Re: inconsistency between the VM page visibility status and the visibility status of the page

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: "yanhui(dot)xiong" <yanhui(dot)xiong(at)enmotech(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: inconsistency between the VM page visibility status and the visibility status of the page
Date: 2023-07-20 10:16:26
Message-ID: 1eac7a08-b41f-1ab7-91b6-24df2dfd9c91@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7/20/23 08:44, yanhui.xiong wrote:
> Hi,
>
> i had a issue here, When executing a SELECT statement using an
> index-only scan, i got a wrong row number because there may be an
> inconsistency between the VM page visibility status and the visibility
> status of the page,the VM bit is set and page-level is clear
>
>
> i read the code and note that there has a chance to happen like this,but
> how it happens?
>
> the code do clear the page-level visibility and vm bit at the same time,
> i don not understand how it happens
>

Well, by only looking at the code you're assuming two things:

1) the code is correct

2) the environment is perfect

Either (or both) of these assumptions may be wrong. There certainly
could be some subtle bug in the visibility map code, who knows. Or maybe
this is due to some sort of data corruption outside postgres.

It's impossible to answer without you digging much deeper and providing
much more information. What's the environment? What hardware? What PG
version? How long is it running? Any crashes? Any other cases of similar
issues? What does the page look like in pageinspect?

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Pyhalov 2023-07-20 10:23:44 Re: Partial aggregates pushdown
Previous Message Bharath Rupireddy 2023-07-20 10:14:12 Re: Support worker_spi to execute the function dynamically.