Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3gyT-0002Qg-Ko for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jul 2021 15:39:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3gyS-0001Kr-K6 for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jul 2021 15:39:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3gyS-0001Kj-A4 for pgsql-hackers@lists.postgresql.org; Wed, 14 Jul 2021 15:39:00 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m3gyP-0006PI-OH for pgsql-hackers@lists.postgresql.org; Wed, 14 Jul 2021 15:38:59 +0000 Received: by mail-pj1-x1036.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso1973731pjp.2 for ; Wed, 14 Jul 2021 08:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vJb7isItf0tz766VaNb75XNFBFgBMM5FMppzteZywJI=; b=XlAgZuetozZnGFcvzwZ7K338xvF6WAXOFrHajZCfZCHBdf/HE8tvLxW+3KAF1A3VqF gF1uHDmjM+hcF4mtB/HeQyvEqXrdx/G3hj+lFxj2pvOYBr8a5IcNYwbYnvAOV64Qh6zb KrqDNIfWyvU2LeWA+9AZr3g3IL/fHnC7HNzErafN6oLLpWyKlTjsXVP4N4uU3XBBDJ0a l+yjADgZMi6aNAAaY1BQCbyJZFnblkE3s/VJAfk19F787hM/YIRrC5djenJVIe8yiEV6 CT+bZG/qQB9Yde1gQXQP0Rq11XmyOzpuqh3/es5vK0JTzlJ76tbvjlY68Bdpu5zVmLge KPKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vJb7isItf0tz766VaNb75XNFBFgBMM5FMppzteZywJI=; b=roU8X5KUGU0XqKp6bMLoJea48BNNZV4uZ7iz0uJ7pHLI7jNqtjlo6duDg7wI8Vwl4X BKmSyGxOst/fPFDiGBMZbrxDurnPKnCuwrz5n79c2myNcx9q8HKBq5N0Bi0jJTm17u55 mR1f6E/NKBpwVeDSqdaUFN++DmzKXfrCg/eVm1d2nPebPPJzeqKpPTcBemQ2V4fUyrcW NjetG5TcsiMhmenb+yHb/rKDAafChTZRa8Ikc1BpyesVTD4yR+ejTh8BDAXZ0R7ANQL/ 0OpjDjdDY5deRSOiayEGJkmmZGxeG0WnOzFXgQdD1M/JgI/BacOXaSMZ+RBqkuXaTBJm z/JA== X-Gm-Message-State: AOAM5333jtSsEPvE22anDjjEMNuBMRmXTbqrKUM3iB0E9EIb5VT6VIAV fZBO8DUchD6vAFvUXPyfClExbX2PFR2XJNEuXqJZffnY+F4iRaVr+IRzGPl91udhgl4y5ujckv1 SuNv+GDsyFrbKSTGlcT6ivwqsW9kW+a+To/P5hyTaMoTuCFUjOfxbSPPhSIg03pnNdGe437dhEK 3KzbQpdgImx8wriLVDwZZa4/FlYhzRsO66W5PirqaJjzfWTRZZUbqv X-Google-Smtp-Source: ABdhPJxkBWHCFA1AHoybS6EFMQNZ27jNCjdOPzKMKBoGNQz4unyaenr1aMjU6fETKOQ7Gxo1etXcQA== X-Received: by 2002:a17:903:1243:b029:ed:8298:7628 with SMTP id u3-20020a1709031243b02900ed82987628mr8034636plh.11.1626277136182; Wed, 14 Jul 2021 08:38:56 -0700 (PDT) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id g141sm3297086pfb.210.2021.07.14.08.38.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jul 2021 08:38:55 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: Extending amcheck to check toast size and compression From: Mark Dilger In-Reply-To: <29751EFD-91D8-4F2F-8416-030AD067F260@enterprisedb.com> Date: Wed, 14 Jul 2021 08:38:54 -0700 Cc: Aleksander Alekseev , pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <00CE66F2-EAAB-4676-AFD2-8D614162F9F1@enterprisedb.com> References: <484213DD-9F6E-440F-885F-0B31C600430F@enterprisedb.com> <162083278007.16755.9306912342451528285.pgcf@coridan.postgresql.org> <8729a485-e138-2e18-0d66-74f15ac0c3cc@iki.fi> <29751EFD-91D8-4F2F-8416-030AD067F260@enterprisedb.com> To: Heikki Linnakangas X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jul 14, 2021, at 7:57 AM, Mark Dilger = wrote: >=20 > so no valid toast pointer should contain a va_rawsize field greater = than MaxAllocSize ... nor should any valid toast pointer contain a va_extinfo field = encoding a va_extsize greater than va_rawsize - VARHDRSZ. Violations of either of these properties suggest either a bug in the = code which wrote the toast pointer, or that the toast pointer has been = corrupted since being written, or that the page of data being read is = being interpreted incorrectly, perhaps due to catalog corruption, or = because the page is just random noise and not part of a valid table, = etc. The amcheck code is not focused specifically on whether the = toasted value can be detoasted so much as deducing that the data cannot = be correct. =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company