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/