Thread: minor issues in pg_rewind

minor issues in pg_rewind

From
Fujii Masao
Date:
Hi,

Attached patch fixes the minor issues in pg_rewind. The fixes are

* Remove invalid option character "N" from the third argument (valid option
string) of getopt_long().

* Use pg_free() or pfree() to free the memory allocated by pg_malloc() or
palloc() instead of always using free().

* Assume problem is no disk space if write() fails but doesn't set errno.

* Fix several typos.

Regards,

--
Fujii Masao

Attachment

Re: minor issues in pg_rewind

From
Michael Paquier
Date:
On Thu, Jun 11, 2015 at 2:38 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
> * Remove invalid option character "N" from the third argument (valid option
> string) of getopt_long().
> * Use pg_free() or pfree() to free the memory allocated by pg_malloc() or
> palloc() instead of always using free().
> * Assume problem is no disk space if write() fails but doesn't set errno.
> * Fix several typos.

This looks good to me, especially the ENOSPC enforcement for
pg_control. We may want to rename datapagemap_iterate to
datapagemap_init as well. I can't really see what iterate means in
this context.
Regards,
-- 
Michael



Re: minor issues in pg_rewind

From
Fujii Masao
Date:
On Thu, Jun 11, 2015 at 10:21 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Thu, Jun 11, 2015 at 2:38 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> * Remove invalid option character "N" from the third argument (valid option
>> string) of getopt_long().
>> * Use pg_free() or pfree() to free the memory allocated by pg_malloc() or
>> palloc() instead of always using free().
>> * Assume problem is no disk space if write() fails but doesn't set errno.
>> * Fix several typos.
>
> This looks good to me, especially the ENOSPC enforcement for
> pg_control.

Thanks for reviewing the patch! I just pushed it.

> We may want to rename datapagemap_iterate to
> datapagemap_init as well. I can't really see what iterate means in
> this context.

returning an iterator object, maybe. The pair of iterator() and next() is
common way to walk through the entries, so I can live with the current
naming of the function.

Regards,

-- 
Fujii Masao