Re: Regarding WAL Format Changes

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: "'Heikki Linnakangas'" <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: "'Pg Hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Regarding WAL Format Changes
Date: 2012-06-28 03:54:25
Message-ID: 002801cd54e1$b6222c00$22668400$@kapila@huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


From: Heikki Linnakangas [mailto:heikki(dot)linnakangas(at)enterprisedb(dot)com]
Sent: Wednesday, June 27, 2012 8:26 PM
On 27.06.2012 17:14, Amit Kapila wrote:
>> 2. @@ -2680,8 +2645,8 @@ InstallXLogFileSegment(uint32 *log, uint32 *seg,
>> char *tmppath,
>> LWLockRelease(ControlFileLock);
>> ereport(LOG,
>> (errcode_for_file_access(),
>> - errmsg("could not link file \"%s\" to
>> \"%s\" (initialization of log file %u, segment %u): %m",
>> - tmppath, path, *log,
>> *seg)));
>> + errmsg("could not link file \"%s\" to
>> \"%s\" (initialization of log file): %m",
>> + tmppath, path)));
>> If Changed error message can contain log file and segment number, it
>> would be more clear. That should be easily
>> deducible from segment number.

>That seems redundant. The target file name is calculated from the
>segment number, and we're now using the file name instead of log+seg in
>other messages too.

errmsg("could not link file \"%s\" to \"%s\" (initialization of log file):
%m", + tmppath, path)));

In this if we try to get the meaning of second part of message
"(initialization of log file)", it was much
better previously as in this message it refers 2 files and previously it was
clear initialization of which log
file failed. So we can mention file name in second part of message
"(initialization of log file)" as well.

>> 3. -RemoveOldXlogFiles(uint32 log, uint32 seg, XLogRecPtr endptr)
>> For the above 2 changed error messages, 'log segment' is used for
>> filename.
>> However all similar changes has 'log file' for filename. There are
some
>> places
>> where 'log segment' is used and other places it is 'log file'.
>> So is there any particular reason for it?

> Not really. There are several messages that use "log file %s", and also
> several places that use "log segment %s" Should we make it consistent
> and use either "log segment" or "log file" everywhere?

'file' seems to be better option as some users may not be even aware of
segments, they would be using default values of segments and they can relate
to 'file' easily.
Also using 'WAL' instead of 'log' as suggested by Alvaro is good if others
also thinks same.

With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-06-28 04:41:35 Re: We probably need autovacuum_max_wraparound_workers
Previous Message Tom Lane 2012-06-28 03:38:39 Re: We probably need autovacuum_max_wraparound_workers