pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wong, Yi Wen <yiwong@amazon.com>
To: Peter Geoghegan <pg@bowt.ie>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Wood, Dan <hexpert@amazon.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
Date: Fri, 6 Oct 2017 21:09:12 +0000
Message-ID: <1507324152711.78083@amazon.com> (raw)
In-Reply-To: <CAH2-WzkR0m4ZBrPgvUF2GaLQtwimN6xhXBbGzBc51mNfZeo73w@mail.gmail.com>
References: <CAH2-Wz=-eBQTEAfb_vnzMpYqH0EGEiohcYSmc=ykH_Y9fNywww@mail.gmail.com>
	<20171006174956.4kofump6jcmlnjci@alvherre.pgsql>
	<CAH2-WznvU6=x3z7ND_c7Nffx6_t-k8OQWE64H_Da5bvSCwSQFA@mail.gmail.com>
	<CAH2-WzkR0m4ZBrPgvUF2GaLQtwimN6xhXBbGzBc51mNfZeo73w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

>On Fri, Oct 6, 2017 at 11:34 AM, Peter Geoghegan <pg@bowt.ie> wrote:
>>> I don't know if it's really the freeze map at fault or something else.
>>
>> Ideally, it would be possible to effectively disable the new freeze
>> map stuff in a minimal way, for testing purposes. Perhaps the authors
> of that patch, CC'd, can suggest a way to do that.

>Actually, the simplest thing might be to just use pg_visibility's
>pg_check_frozen() to check that the visibility/freeze map accurately
>summarizes the all-frozen status of tuples in the heap. If that
>doesn't indicate that there is corruption, we can be fairly confident
>that the problem is elsewhere. The metadata in the visibility/freeze
>map should be accurate when a bit is set to indicate that an entire
>heap page is all-frozen (or, separately, all-visible). We can hardly
>expect it to have better information that the authoritative source of
>truth, the heap itself.

>The more I think about it, the more I tend to doubt that the remaining
>problems are with the freeze map. If the freeze map was wrong, and
>incorrectly said that a page was all-frozen, then surely the outward
>symptoms would take a long time to show up, as they always do when we
>accidentally fail to freeze a tuple before a relfrozenxid cutoff. ISTM
>that that's the only meaningful way that the freeze map can be wrong
>-- it only promises to be accurate when it says that no further
>freezing is needed for a page/bit.

Yesterday, I've been spending time with pg_visibility on the pages when I reproduce the issue in 9.6.
None of the all-frozen or all-visible bits are necessarily set in problematic pages.

ERROR:  failed to find parent tuple for heap-only tuple at (0,182) in table "accounts"

 blkno | all_visible | all_frozen | pd_all_visible 
-------+-------------+------------+----------------
     0 | f           | f          | f
(1 row)

Even when the bits were set, I haven't found issues with the pg_check_xxx functions in the dozens of times I've run them.

postgres=# select * from pg_visibility('accounts'::regclass);
 blkno | all_visible | all_frozen | pd_all_visible 
-------+-------------+------------+----------------
     0 | f           | f          | f
     1 | t           | t          | t
(2 rows)

postgres=# select pg_check_visible('accounts'::regclass);
 pg_check_visible 
------------------
(0 rows)

postgres=# select pg_check_frozen('accounts'::regclass);
 pg_check_frozen 
-----------------
(0 rows)

Yi Wen

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



view thread (129+ messages)  latest in thread

Message-ID: <1507324152711.78083@amazon.com>
Permalink:  ../1507324152711.78083@amazon.com/
Also on:    postgresql.org/message-id/1507324152711.78083@amazon.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: yiwong@amazon.com, pg@bowt.ie, alvherre@alvh.no-ip.org, hexpert@amazon.com, michael.paquier@gmail.com, pgsql-hackers@postgresql.org, robertmhaas@gmail.com
  Subject: Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple
  In-Reply-To: <1507324152711.78083@amazon.com>
  References: <CAH2-Wz=-eBQTEAfb_vnzMpYqH0EGEiohcYSmc=ykH_Y9fNywww@mail.gmail.com> <20171006174956.4kofump6jcmlnjci@alvherre.pgsql> <CAH2-WznvU6=x3z7ND_c7Nffx6_t-k8OQWE64H_Da5bvSCwSQFA@mail.gmail.com> <CAH2-WzkR0m4ZBrPgvUF2GaLQtwimN6xhXBbGzBc51mNfZeo73w@mail.gmail.com> <1507324152711.78083@amazon.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox