Re: Deduplicate code updating ControleFile's DBState.

Поиск
Список
Период
Сортировка
От Bossart, Nathan
Тема Re: Deduplicate code updating ControleFile's DBState.
Дата
Msg-id 558D6677-69B6-4D2C-BE0A-D41049214FE2@amazon.com
обсуждение исходный текст
Ответ на Re: Deduplicate code updating ControleFile's DBState.  (Amul Sul <sulamul@gmail.com>)
Ответы Re: Deduplicate code updating ControleFile's DBState.  (Amul Sul <sulamul@gmail.com>)
Список pgsql-hackers
On 9/20/21, 10:07 PM, "Amul Sul" <sulamul@gmail.com> wrote:
> On Tue, Sep 21, 2021 at 4:44 AM Bossart, Nathan <bossartn@amazon.com> wrote:
>> On 9/19/21, 11:07 PM, "Amul Sul" <sulamul@gmail.com> wrote:
>> > I have one additional concern about the way we update the control
>> > file, at every place where doing the update, we need to set control
>> > file update time explicitly, why can't the time update line be moved
>> > to UpdateControlFile() so that time gets automatically updated?
>>
>> I see a few places where UpdateControlFile() is called without
>> updating ControlFile->time.  I haven't found any obvious reason for
>> that, so perhaps it would be okay to move it to update_controlfile().
>>
>
> Ok, thanks, did the same in the attached version.

void
UpdateControlFile(void)
{
+    ControlFile->time = (pg_time_t) time(NULL);
    update_controlfile(DataDir, ControlFile, true);
}

Shouldn't we update the time in update_controlfile()?  Also, can you
split this change into two patches (i.e., one for the timestamp change
and another for the refactoring)?  Otherwise, this looks reasonable to
me.

Nathan


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: proposal: possibility to read dumped table's name from file
Следующее
От: "蔡梦娟(玊于)"
Дата:
Сообщение: 回复:Queries that should be canceled will get stuck on secure_write function