Re: Assert in pageinspect with NULL pages
Maxim Orlov <orlovmg@gmail.com>
From: Maxim Orlov <orlovmg@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Geoghegan <pg@bowt.ie>, Robert Haas <robertmhaas@gmail.com>, Alexander Lakhin <exclusion@gmail.com>, Justin Pryzby <pryzby@telsasoft.com>, Daria Lepikhova <d.lepikhova@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-03-28T17:29:29Z
Lists: pgsql-hackers
I've suddenly found that the test in this patch is based on a fact that
heap pages don't have PageSpecial or it is of different size with btree
pages Special area:
CREATE TABLE test1 (a int8, b int4range);
SELECT bt_page_items(get_raw_page('test1', 0));
In the current state is is so, but it is not guaranteed. For example, in
the proposed 64xid patch [1] we introduce PageSpecial into heap pages and
its size on occasion equals to the size of btree page special so check from
above is false. Even if we pass heap page into pageinspect pretending it is
btree page. So the test will fail.
Generally it seems not only a wrong test but the consequence of a bigger
scale fact that we can not always distinguish different AM's pages. So I'd
propose at least that we don't come to a conclusion that a page is valid
based on PageSpecial size is right.
[1]
https://www.postgresql.org/message-id/flat/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe%3DpyyjVWA%40mail.gmail.com
--
Best regards,
Maxim Orlov.
Commits
-
pageinspect: Fix handling of all-zero pages
- 12d32b7bc151 10.21 landed
- 79fed072ba5f 11.16 landed
- 5378d55cb2f3 12.11 landed
- 2275d044d084 13.7 landed
- df6bbe73b86c 14.3 landed
- cd4868a5700f 15.0 landed
-
pageinspect: Add more sanity checks to prevent out-of-bound reads
- ab80b0fbbbc4 10.21 landed
- 1a2fdf86aae8 11.16 landed
- 5ca2aa2f26ea 12.11 landed
- 3d4d6dee0777 13.7 landed
- 27d384441851 14.3 landed
- 291e517a4dc9 15.0 landed
-
pageinspect: Fix handling of page sizes and AM types
- c42b88932b9d 10.21 landed
- 2389ee8dd800 11.16 landed
- af8a8eb54245 12.11 landed
- d3a9b83c30b6 13.7 landed
- b61e6214cfac 14.3 landed
- 076f4d9539e9 15.0 landed
-
Teach pageinspect about nbtree deduplication.
- 93ee38eade1b 13.0 cited