Re: basebackup.c's sendFile() ignores read errors - Mailing list pgsql-hackers

From Jeevan Chalke
Subject Re: basebackup.c's sendFile() ignores read errors
Date
Msg-id CAM2+6=UafA__zVDuXa7iQ6SWhPo44_5iL=LPWNR-S=gNYx7fLQ@mail.gmail.com
Whole thread Raw
In response to Re: basebackup.c's sendFile() ignores read errors  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Responses Re: basebackup.c's sendFile() ignores read errors  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
List pgsql-hackers


On Thu, Aug 29, 2019 at 3:17 PM Jeevan Ladhe <jeevan.ladhe@enterprisedb.com> wrote:
Hi Jeevan

I had a look at the patch and this seems correct to me.

Thanks, Jeevan Ladhe.
 

Few minor comments:

+ /* Check fread() error. */
+ CHECK_FREAD_ERROR(fp, pathbuf);
+

The comments above the macro call at both the places are not necessary as
your macro name itself is self-explanatory.

----------
+ /*
+ * If file is truncated, then we will hit
+ * end-of-file error in which case we don't
+ * want to error out, instead just pad it with
+ * zeros.
+ */
+ if (feof(fp))

The if block does not do the truncation right away, so I think the comment
above can be reworded to explain why we reset cnt?

Fixed both comments in the attached patch.
 
--
Jeevan Chalke
Technical Architect, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: Kuntal Ghosh
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs
Next
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] CLUSTER command progress monitor