Re: verify_heapam for sequences?
От | Mark Dilger |
---|---|
Тема | Re: verify_heapam for sequences? |
Дата | |
Msg-id | 981D0BBA-6E8A-4D6E-BC0A-7195A6F53A15@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: verify_heapam for sequences? (Peter Eisentraut <peter.eisentraut@enterprisedb.com>) |
Ответы |
Re: verify_heapam for sequences?
|
Список | pgsql-hackers |
> On Aug 30, 2021, at 1:22 AM, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote: > > On 26.08.21 21:02, Mark Dilger wrote: >> I understand that sequences are really just heap tables, and since we already test corrupted heap tables, we could assumethat we already have sufficient coverage. I'm not entirely comfortable with that, though, because future patch authorswho modify how tables or sequences work are not necessarily going to think carefully about whether their modificationsinvalidate that assumption. > > Well, if we enabled verify_heapam to check sequences, and then someone were to change the sequence storage, a test thatcurrently reports no corruption would probably report corruption then? It might. More to the point, any corruption test we create now will be geared towards corrupting the page in a way thatverify_heapam will detect, which will be detected whether or not the implementation of sequences changes. That kindof testing won't really do anything. Perhaps the best we can do is to create a sequence, testing both before and after exercising it a bit. We can't properlyguess which exercises (nextval, setval, etc.) will cause corruption testing to fail for some unknown future implementationchange, so we just try all the obvious stuff. The attached patch changes both contrib/amcheck/ and src/bin/pg_amcheck/ to allow checking sequences. In both cases, thechanges required are fairly minor, though they both entail some documentation changes. It seems fairly straightforward that if a user calls verify_heapam() on a sequence, then the new behavior is what they want. It is not quite so clear for pg_amcheck. In pg_amcheck, the command-line arguments allow discriminating between tables and indexes with materialized views quietlytreated as tables (which, of course, they are.) In v14, sequences were not treated as tables, nor checked at all. In this new patch, sequences are quietly treated the same way as tables. By "quietly", I mean there are no command-lineswitches to specifically filter them in or out separately from filtering ordinary tables. This is a user-facing behavioral change, and the user might not be imagining sequences specifically when specifying a tablename pattern that matches both tables and sequences. Do you see any problem with that? It was already true that materializedviews matching a table name pattern would be checked, so this new behavior is not entirely out of line with theold behavior. The new behavior is documented, and since I'm updating the docs, I made the behavior with respect to materialized views moreexplicit. — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Вложения
В списке pgsql-hackers по дате отправления: