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