Re: Have better wording for snapshot file reading failure

Yogesh Sharma <yogesh.sharma@catprosystems.com>

From: Yogesh Sharma <yogesh.sharma@catprosystems.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-09-13T10:02:46Z
Lists: pgsql-hackers
On 9/13/23 02:10, Bharath Rupireddy wrote:
> Hi,
>
> When a snapshot file reading fails in ImportSnapshot(), it errors out
> with "invalid snapshot identifier". This message better suits for
> snapshot identifier parsing errors which is being done just before the
> file reading. The attached patch adds a generic file reading error
> message with path to help distinguish if the issue is with snapshot
> identifier parsing or file reading.
>
I suggest error message to include "snapshot" keyword in message, like this:

errmsg("could not open snapshot file \"%s\" for reading: %m",

and also tweak other messages accordingly.


-- 
Kind Regards,
Yogesh Sharma
PostgreSQL, Linux, and Networking Expert
Open Source Enthusiast and Advocate




Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Improve error message for snapshot import in snapmgr.c, take two

  2. Revert "Improve error message on snapshot import in snapmgr.c"

  3. Improve error message on snapshot import in snapmgr.c