Skip to content

Commit d5b9b2d

Browse files
committed
Remove misleading hint for "unexpected data beyond EOF" error.
Commit ffae5cc added this hint in 2006, but it's now obsolete and doesn't reflect what users should really check in this situation. We were not able to agree on a new hint, so just delete the existing one and update the comments to mention one possibility that is known to cause problems of this kind: something other than PostgreSQL is modifying files in the PostgreSQL data directory. Author: Jakub Wartak <jakub.wartak@enterprisedb.com> Reviewed-by: Robert Haas <rhaas@postgresql.org> Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Christoph Berg <myon@debian.org> Discussion: https://postgr.es/m/CAKZiRmxNbcaL76x=09Sxf7aUmrRQJBf8drzDdUHo+j9_eM+VMg@mail.gmail.com
1 parent dcc9820 commit d5b9b2d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,11 +2743,9 @@ ExtendBufferedRelShared(BufferManagerRelation bmr,
27432743
* because mdread doesn't complain about reads beyond EOF (when
27442744
* zero_damaged_pages is ON) and so a previous attempt to read a block
27452745
* beyond EOF could have left a "valid" zero-filled buffer.
2746-
* Unfortunately, we have also seen this case occurring because of
2747-
* buggy Linux kernels that sometimes return an lseek(SEEK_END) result
2748-
* that doesn't account for a recent write. In that situation, the
2749-
* pre-existing buffer would contain valid data that we don't want to
2750-
* overwrite. Since the legitimate cases should always have left a
2746+
*
2747+
* This has also been observed when relation was overwritten by external
2748+
* process. Since the legitimate cases should always have left a
27512749
* zero-filled buffer, complain if not PageIsNew.
27522750
*/
27532751
if (existing_id >= 0)
@@ -2778,8 +2776,7 @@ ExtendBufferedRelShared(BufferManagerRelation bmr,
27782776
ereport(ERROR,
27792777
(errmsg("unexpected data beyond EOF in block %u of relation %s",
27802778
existing_hdr->tag.blockNum,
2781-
relpath(bmr.smgr->smgr_rlocator, fork).str),
2782-
errhint("This has been seen to occur with buggy kernels; consider updating your system.")));
2779+
relpath(bmr.smgr->smgr_rlocator, fork).str)));
27832780

27842781
/*
27852782
* We *must* do smgr[zero]extend before succeeding, else the page

0 commit comments

Comments
 (0)