[PATCH] Fix error message in RemoveWalSummaryIfOlderThan to indicate file removal failure - Mailing list pgsql-hackers

From zengman
Subject [PATCH] Fix error message in RemoveWalSummaryIfOlderThan to indicate file removal failure
Date
Msg-id tencent_3BBE865C5F49D452360FF190@qq.com
Whole thread Raw
Responses Re: [PATCH] Fix error message in RemoveWalSummaryIfOlderThan to indicate file removal failure
List pgsql-hackers
Hi all,

I noticed a small issue. In `RemoveWalSummaryIfOlderThan`,an `unlink()` failure incorrectly logs "could not stat file",
likelya copy-paste error.
 
I updated it to "could not remove file". No functional changes.

```
diff --git a/src/backend/backup/walsummary.c b/src/backend/backup/walsummary.c
index 21164faac7e..4ee510092f9 100644
--- a/src/backend/backup/walsummary.c
+++ b/src/backend/backup/walsummary.c
@@ -251,7 +251,7 @@ RemoveWalSummaryIfOlderThan(WalSummaryFile *ws, time_t cutoff_time)
     if (unlink(path) != 0)
         ereport(ERROR,
                 (errcode_for_file_access(),
-                 errmsg("could not stat file \"%s\": %m", path)));
+                 errmsg("could not remove file \"%s\": %m", path)));
     ereport(DEBUG2,
             (errmsg_internal("removing file \"%s\"", path)));
 }
```

--
regards,
Man Zeng
Attachment

pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: Improving tracking/processing of buildfarm test failures
Next
From: Junwang Zhao
Date:
Subject: Re: Batching in executor