minor issues in pg_rewind

Started by Fujii Masaoalmost 11 years ago3 messageshackers
Jump to latest
#1Fujii Masao
masao.fujii@gmail.com

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

Attachments:

fix_minor_issues_in_pg_rewind_v1.patchtext/x-diff; charset=US-ASCII; name=fix_minor_issues_in_pg_rewind_v1.patchDownload+20-14
#2Michael Paquier
michael@paquier.xyz
In reply to: Fujii Masao (#1)
Re: minor issues in pg_rewind

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Fujii Masao
masao.fujii@gmail.com
In reply to: Michael Paquier (#2)
Re: minor issues in pg_rewind

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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers