[Patch] Checksums for SLRU files

From: Ivan Kartyshov <i(dot)kartyshov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [Patch] Checksums for SLRU files
Date: 2017-12-31 17:30:25
Message-ID: fec4857dbb1ddaccaafc6f6c7f71f0a7@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello, I`d like to show my implementation of SLRU file protection with

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
ALTER SYSTEM SET ignore_slru_checksum_failure = off;
SELECT pg_reload_conf();

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

Attachment Content-Type Size
slruchecksums.patch text/x-diff 8.9 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-12-31 17:38:15 Re: [HACKERS] Re: [HACKERS] generated columns
Previous Message Peter Eisentraut 2017-12-31 17:23:06 Re: What does Time.MAX_VALUE actually represent?