Re: Fix checkpoint skip logic on idle systems by tracking LSN progress

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Fix checkpoint skip logic on idle systems by tracking LSN progress
Дата
Msg-id CAB7nPqS-nFO2xKa6R4B-u4KqU_OCPLMGPv+kkAG9Q7zunDtq6w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix checkpoint skip logic on idle systems by tracking LSN progress  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: Fix checkpoint skip logic on idle systems by tracking LSN progress  (Amit Kapila <amit.kapila16@gmail.com>)
Re: [HACKERS] Fix checkpoint skip logic on idle systems by trackingLSN progress  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Wed, Nov 30, 2016 at 7:53 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Mon, Nov 21, 2016 at 11:08 AM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
>> On Tue, Nov 15, 2016 at 9:59 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>>> On Tue, Nov 15, 2016 at 9:27 AM, Kyotaro HORIGUCHI
>>> <horiguchi.kyotaro@lab.ntt.co.jp> wrote:
>>>> The term "WAL activity' is used in the comment for
>>>> GetProgressRecPtr. Its meaning is not clear but not well
>>>> defined. Might need a bit detailed explanation about that or "WAL
>>>> activity tracking". What do you think about this?
>>>>
>>>
>>> I would have written it as below:
>>>
>>> GetProgressRecPtr -- Returns the WAL progress.  WAL progress is
>>> determined by scanning each WALinsertion lock by taking directly the
>>> light-weight lock associated to it.
>>
>> Not sure if that's better.. What about something as fancy as that?
>>  /*
>> - * Get the time of the last xlog segment switch
>> + * GetProgressRecPtr -- Returns the newest WAL progress position.  WAL
>> + * progress is determined by scanning each WALinsertion lock by taking
>> + * directly the light-weight lock associated to it.  The result of this
>> + * routine can be compared with the last checkpoint LSN to check if
>> + * a checkpoint can be skipped or not.
>> + *
>> It may be worth mentioning that the result of this routine is
>> basically used for checkpoint skip logic.
>>
>
> That's okay, but I think you are using it to skip switch segment stuff
> as well.  Today, again going through patch, I noticed small anomaly
>
>> + * Switch segment only when WAL has done some progress since the
> + * > last time a segment has switched because of a timeout.
>
>> + if (GetProgressRecPtr() > last_switch_lsn)
>
> Either the above comment is wrong or the code after it has a problem.
> last_switch_lsn aka XLogCtl->lastSegSwitchLSN is updated not only for
> a timeout but also when there is a lot of WAL activity which makes WAL
> Write to cross a segment boundary.

Right, this should be reworded a bit better to mention both. Done as attached.
--
Michael

Вложения

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

Предыдущее
От: Haribabu Kommi
Дата:
Сообщение: Re: LOCK TABLE .. DEFERRABLE
Следующее
От: Haribabu Kommi
Дата:
Сообщение: Re: VACUUM's ancillary tasks