Remove useless arguments in ReadCheckpointRecord().

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Remove useless arguments in ReadCheckpointRecord().
Дата
Msg-id fa2e12eb-81c3-0717-0272-755f8a81c8f2@oss.nttdata.com
обсуждение исходный текст
Ответы Re: Remove useless arguments in ReadCheckpointRecord().  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
Hi,

I'd like to propose to remove "whichChkpt" and "report" arguments in ReadCheckpointRecord(). "report" is obviously
uselessbecause it's always true, i.e., there are two callers of the function and they always specify true as "report".
 

"whichChkpt" indicates where the specified checkpoint location came from, pg_control or backup_label. This information
isused to log different messages as follows.
 

        switch (whichChkpt)
        {
            case 1:
                ereport(LOG,
                        (errmsg("invalid primary checkpoint link in control file")));
                break;
            default:
                ereport(LOG,
                        (errmsg("invalid checkpoint link in backup_label file")));
                break;
        }
        return NULL;
        ...
        switch (whichChkpt)
        {
            case 1:
                ereport(LOG,
                        (errmsg("invalid primary checkpoint record")));
                break;
            default:
                ereport(LOG,
                        (errmsg("invalid checkpoint record")));
                break;
        }
        return NULL;
        ...

But the callers of ReadCheckpointRecord() already output different log messages depending on where the invalid
checkpointrecord came from. So even if ReadCheckpointRecord() doesn't use "whichChkpt", i.e., use the same log message
inboth pg_control and backup_label cases, users can still identify where the invalid checkpoint record came from, by
readingthe log message.
 

Also when whichChkpt = 0, "primary checkpoint" is used in the log message and sounds confusing because, as far as I
recallcorrectly, we removed the concept of primary and secondary checkpoints before.
 

  Therefore I think that it's better to remove "whichChkpt" argument in ReadCheckpointRecord().

Patch attached. Thought?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Önder Kalacı
Дата:
Сообщение: Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher
Следующее
От: Justin Pryzby
Дата:
Сообщение: [PATCH] Renumber confusing value for GUC_UNIT_BYTE