Re: fix_PGSTAT_NUM_TABENTRIES_macro patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: fix_PGSTAT_NUM_TABENTRIES_macro patch
Дата
Msg-id 19756.1388705888@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: fix_PGSTAT_NUM_TABENTRIES_macro patch  (Mark Dilger <markdilger@yahoo.com>)
Ответы Re: fix_PGSTAT_NUM_TABENTRIES_macro patch  (Mark Dilger <markdilger@yahoo.com>)
Список pgsql-hackers
Mark Dilger <markdilger@yahoo.com> writes:
> I still don't understand why this case in src/include/pgstat.h
> is different from cases elsewhere in the code.

The reason why I'm exercised about it is that (a) somebody actually made a
mistake of this type, and (b) it wasn't caught by any automated testing.

The catalog and WAL-related examples you cite would probably crash
and burn in fairly obvious ways if somebody broke them --- for instance,
the most likely way to break SizeOfHeapHeader would be by adding another
field after t_hoff, but we'd notice that before long because said field
would be corrupted on arrival at a replication slave.

In contrast, messing up the pgstats message sizes would have no
consequences worse than a hard-to-detect, and probably platform-specific,
performance penalty for stats transmission.  So unless we think that's
of absolutely zero concern, adding a mechanism to make such bugs more
apparent seems useful.

I'm not against adding more assertions elsewhere, but it's a bit hard to
see what those asserts should test.  I don't see any practical way to
assert that field X is the last one in its struct, for instance.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: fix_PGSTAT_NUM_TABENTRIES_macro patch
Следующее
От: Mark Dilger
Дата:
Сообщение: Re: fix_PGSTAT_NUM_TABENTRIES_macro patch