Re: improving basebackup.c's file-reading code - Mailing list pgsql-hackers

From Hamid Akhtar
Subject Re: improving basebackup.c's file-reading code
Date
Msg-id 158815386912.780.17053485990951720407.pgcf@coridan.postgresql.org
Whole thread Raw
In response to improving basebackup.c's file-reading code  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: improving basebackup.c's file-reading code
List pgsql-hackers
The following review has been posted through the commitfest application:
make installcheck-world:  tested, passed
Implements feature:       tested, passed
Spec compliant:           not tested
Documentation:            tested, passed

The idea and the patch looks good to me. 

It makes sense to change fread to basebackup_read_file which internally calls pg_pread which is a portable function as
opposedto read. As you've mentioned, this is much better for error handling.
 

I guess it is more of a personal choice, but I would suggest making the while conditions consistent as well. The while
loopin the patch @ line 121 conditions over return value of "basebackup_read_file" whereas @ line 177, it has a
condition"(len < statbuf->st_size)". 

The new status of this patch is: Ready for Committer

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Next
From: Peter Eisentraut
Date:
Subject: Re: Proposing WITH ITERATIVE