fix "Success" error messages

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: fix "Success" error messages
Date: 2019-06-18 12:35:02
Message-ID: 5de61b6b-8be9-7771-0048-860328efe027@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In a case of a corrupted database, I saw an error message like

Could not read from file ...: Success.

from the SLRU module. This is because it checks that it reads or writes
exactly BLCKSZ, and else goes to the error path. The attached patch
gives a different error message in this case.

Because of the structure of this code, we don't have the information to
do the usual "read %d of %zu", but at least this is better than
reporting a "success" error.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Better-error-messages-for-short-reads-writes-in-SLRU.patch text/plain 1.7 KB
0002-Use-consistent-style-for-checking-return-from-system.patch text/plain 2.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2019-06-18 13:37:03 Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Previous Message Daniel Gustafsson 2019-06-18 12:05:00 Replacing the EDH SKIP primes