Re: Regarding WAL Format Changes - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Regarding WAL Format Changes
Date
Msg-id 002801cd54e1$b6222c00$22668400$@kapila@huawei.com
Whole thread Raw
In response to Re: Regarding WAL Format Changes  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
From: Heikki Linnakangas [mailto:heikki.linnakangas@enterprisedb.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.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: We probably need autovacuum_max_wraparound_workers
Next
From: Robert Haas
Date:
Subject: Re: We probably need autovacuum_max_wraparound_workers