Better HINT message for "unexpected data beyond EOF"
Jakub Wartak <jakub.wartak@enterprisedb.com>
From: Jakub Wartak <jakub.wartak@enterprisedb.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-26T08:59:23Z
Lists: pgsql-hackers
Attachments
- repro_beyond_EOF_error.txt (text/plain)
I would like to propose that we tweak the following error message: ERROR: unexpected data beyond EOF in block 1472 of relation base/5/16387 HINT: This has been seen to occur with buggy kernels; consider updating your system. to something more generic and less confusing. It is coming from ffae5cc5a602 (2006), and we are probably not running those "buggy" kernels anywhere. I've seen this error multiple times, but it is usually due to some external influence overwriting/replacing the files in PGDATA and some (potentially new) backends open()ing those "new" files and finding unexpected file layout. In the real world this means usually: a. files being potentially accidentally replaced/overwritten, please see attached file for reproducer b. some obscure bugs (e.g. in EPAS - PG fork - we have on-demand automatic partition creation and we had bug/race conditions where multiple backends end up writing to the same relfilenode oid file) so how about: -HINT: This has been seen to occur with buggy kernels; consider updating your system. +HINT: This has been observed with files being overwritten, buggy kernels and potentially other external file system influence. ? -J.
Commits
-
Remove misleading hint for "unexpected data beyond EOF" error.
- d5b9b2d40262 19 (unreleased) landed
-
md: Add comment & assert to buffer-zeroing path in md[start]readv()
- 00066aa1733d 18.0 cited