Re: Could not read from file "pg_subtrans/00F5" at offset 122880: Success. - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Could not read from file "pg_subtrans/00F5" at offset 122880: Success.
Date
Msg-id 202311291729.d375fgxfxmlp@alvherre.pgsql
Whole thread Raw
In response to Re: Could not read from file "pg_subtrans/00F5" at offset 122880: Success.  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Could not read from file "pg_subtrans/00F5" at offset 122880: Success.
List pgsql-general
On 2023-Nov-28, Kyotaro Horiguchi wrote:

> By the way, just out of curiosity, but errno should not be zero at the
> time the message above was output, yet "%m" is showing "success",
> which implies errno = 0 in Linux. How can that happen?

If the file is exactly of the length given then seek will work, and read
will not set errno but return a length of 0 bytes.  So
SlruPhysicalReadPage sets SLRU_READ_FAILED and then in pg11 the %m in
SlruReportIOError expands to "Success".

The code in master is completely different (it uses pg_pread rather than
seek + read): it does test for errno and reports accordingly.

So, nothing to do here.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



pgsql-general by date:

Previous
From: Sri Mrudula Attili
Date:
Subject: Re: Could not read from file "pg_subtrans/00F5" at offset 122880: Success.
Next
From: Ron Johnson
Date:
Subject: Re: Could not read from file "pg_subtrans/00F5" at offset 122880: Success.