Extending amcheck to check toast size and compression

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Extending amcheck to check toast size and compression
Date: 2021-05-04 16:20:00
Message-ID: C108F673-BF11-41A0-8436-535E998F7A74@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

During the version 14 development period, a few checks of toasted attributes were written but never committed. For the version 15 development cycle, I'd like to consider extending the checks of toasted attributes. First, no toasted attribute should ever have a rawsize larger than the 1GB varlena limit. Second, no compressed toasted attribute should have an extsize indicating that the toast expanded during toasting. Such a extsize could mean the compression code is malfunctioning, or that the extsize or rawsize fields are corrupt. Third, any compressed attribute should have a valid compression method ID.

These checks are cheap. Actually retrieving the compressed toasted data and checking that it uncompresses correctly would have very different performance implications, but that is not included in this patch.

Attachment Content-Type Size
v1-0001-Adding-more-toast-pointer-checks-to-amcheck.patch application/octet-stream 2.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-05-04 16:32:34 Re: Incorrect snapshots while promoting hot standby node when 2PC is used
Previous Message Dilip Kumar 2021-05-04 15:54:33 Re: .ready and .done files considered harmful