Hello, I`d like to show my implementation of SLRU file protection with
checksums.
It only has effect if checksums on database are enabled.
Detection of a checksum failure during a read normally causes PostgreSQL
to report an error. Setting ignore_slru_checksum_failure to on causes
the system to ignore the failure (but still report a warning), and
continue processing. It is similary like ignore_checksum_failure but for
some slru files. The default setting is true, and it can only be changed
by a database admin. For changes, use ALTER SYSTEM and reload
configuration:
ALTER SYSTEM SET ignore_slru_checksum_failure = off;
SELECT pg_reload_conf();
Impementation:
1) Checksum writes in last 2 bytes of every page
2) Checksum calculates and write down in page happens when page writes
on disk (same as relation does it)
3) Checking checksum happens same as relation does it, on
Read\PhysicalRead when GUC ignore_slru_checksum_failure = false
{default = true}.
I would like to hear your thoughts over my patch.
--
Ivan Kartyshov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company