Re: Assert in pageinspect with NULL pages
Daria Lepikhova <d.lepikhova@postgrespro.ru>
From: Daria Lepikhova <d.lepikhova@postgrespro.ru>
To: Michael Paquier <michael@paquier.xyz>
Cc: rjuju123@gmail.com, exclusion@gmail.com, pgsql-hackers@postgresql.org
Date: 2022-02-23T07:09:02Z
Lists: pgsql-hackers
Attachments
- 0001-Add-checks-for-null-pages-into-pageinspect-v2.patch (text/x-patch) patch v2-0001
First of all, thanks for the review and remarks! 18.02.2022 08:02, Michael Paquier пишет: > On Thu, Feb 17, 2022 at 05:40:41PM +0800, Julien Rouhaud wrote: >> About the patch, it's incorrectly using a hardcoded 8192 block-size rather than >> using the computed :block_size (or computing one when it's not already the >> case). > Well, the tests of pageinspect fail would already fail when using a > different page size than 8k, like the checksum ones :) > > Anywa, I agree with your point that if this is not a reason to not > make the tests more portable if we can do easily. Fixed. >> I'm also wondering if it wouldn't be better to return NULL rather than throwing >> an error for uninitialized pages. > Agreed that this is a sensible choice. NULL would be helpful for the > case where one compiles all the checksums of a relation with a full > scan based on the relation size, for example. All these behaviors > ought to be documented properly, as well. For SRFs, this should just > return no rows rather than generating an error. So, I tried to implement this remark. However, further getting rid of throwing an error and replacing it with a NULL return led to reproduce the problem that Alexander Lakhin mentioned And here I need little more time to figure it out. And one more addition. In the previous version of the patch, I forgot to add tests for the gist index, but the described problem is also relevant for it. -- Daria Lepikhova Postgres Professional
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