Re: Deduplicate code updating ControleFile's DBState.

Поиск
Список
Период
Сортировка
От Bossart, Nathan
Тема Re: Deduplicate code updating ControleFile's DBState.
Дата
Msg-id 9928EE76-62C3-402A-9CF4-344DDC79A5B1@amazon.com
обсуждение исходный текст
Ответ на Re: Deduplicate code updating ControleFile's DBState.  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Deduplicate code updating ControleFile's DBState.  (Amul Sul <sulamul@gmail.com>)
Список pgsql-hackers
On 10/1/21, 10:40 PM, "Michael Paquier" <michael@paquier.xyz> wrote:
> On Fri, Oct 01, 2021 at 05:47:45PM +0000, Bossart, Nathan wrote:
>> I'm inclined to agree that anything that calls update_controlfile()
>> should update the timestamp.
>
> pg_control.h tells that:
> pg_time_t   time;           /* time stamp of last pg_control update */
> So, yes, that would be more consistent.
>
>> However, I wonder if the additional
>> calls to time() would have a noticeable impact.
>
> I would not take that lightly either.  Now, I don't think that any of
> the code paths where UpdateControlFile() or update_controlfile() is
> called are hot enough to worry about that.
>
>  UpdateControlFile(void)
>  {
> +       ControlFile->time = (pg_time_t) time(NULL);
>         update_controlfile(DataDir, ControlFile, true);
>  }
> I have to admit that it is a bit strange to do that in the backend but
> not the frontend, so there is a good argument for doing that directly
> in update_controlfile().  pg_resetwal does an update of the time, but
> pg_rewind does not.

I don't see any recent updates to this thread from Amul, so I'm
marking this one as waiting-for-author.

Nathan


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

Предыдущее
От: "Bossart, Nathan"
Дата:
Сообщение: Re: Isn't it better with "autovacuum worker...." instead of "worker took too long to start; canceled" specific to "auto
Следующее
От: Justin Pryzby
Дата:
Сообщение: SIGABRT causes messages at LOG but not PANIC