Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
Date: 2015-07-16 13:41:37
Message-ID: CAHGQGwEd2an6Cv2ikXHnf37XG53RQicEBqGuW+Bi0YkWYezNiw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Jul 3, 2015 at 12:15 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Thu, Jul 2, 2015 at 7:44 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
> wrote:
>>
>> Amit Kapila wrote:
>> >
>> > Added the above log messages in attached patch with small change
>> > such that in message, file names will be displayed with quotes as most
>> > of other usages of rename (failure) in that file uses quotes to display
>> > filenames.
>>
>> Why emit two messages?
>
> not necessary.
>
>> Can we reduce that to a single one? Maybe the
>> first one could be errdetail or something.
>>
>
> I think it is better other way (basically have second one as errdetail).
> We already have one similar message in xlog.c that way.
> ereport(LOG,
> (errmsg("online backup mode canceled"),
> errdetail("\"%s\" was renamed to \"%s\".",
> BACKUP_LABEL_FILE, BACKUP_LABEL_OLD)));
>
> Attached patch consolidates errmsg into one message.

Here are some minor comments:

+ ereport(LOG,
+ (errmsg("ignoring \"%s\" file because no
\"%s\" file exists",
+ TABLESPACE_MAP, BACKUP_LABEL_FILE),
+ errdetail("could not rename file \"%s\" to
\"%s\": %m",
+ TABLESPACE_MAP, TABLESPACE_MAP_OLD)));

WARNING is better than LOG here because it indicates a problematic case?

In detail message, the first word of sentence needs to be capitalized.

+ errdetail("renamed file \"%s\" to \"%s\"",
+ TABLESPACE_MAP, TABLESPACE_MAP_OLD)));

In detail message, basically we should use a complete sentence.
So like other similar detail messages in xlog.c, I think that it's better
to use "\"%s\" was renamed to \"%s\"." as the detail message here.

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2015-07-16 15:21:38 Re: pgsql: AIX: Link TRANSFORM modules with their dependencies.
Previous Message Magnus Hagander 2015-07-16 07:34:32 pgsql: Fix spelling error

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2015-07-16 13:49:40 Volatility of pg_xact_commit_timestamp() and pg_last_committed_xact()
Previous Message Alvaro Herrera 2015-07-16 13:33:59 Re: TABLESAMPLE patch is really in pretty sad shape