Re: Deduplicate code updating ControleFile's DBState. - Mailing list pgsql-hackers

From Bossart, Nathan
Subject Re: Deduplicate code updating ControleFile's DBState.
Date
Msg-id E4089289-16C2-4419-A44D-BACB70806D54@amazon.com
Whole thread Raw
In response to Re: Deduplicate code updating ControleFile's DBState.  (Amul Sul <sulamul@gmail.com>)
Responses Re: Deduplicate code updating ControleFile's DBState.
List pgsql-hackers
On 9/22/21, 10:03 PM, "Amul Sul" <sulamul@gmail.com> wrote:
> On Tue, Sep 21, 2021 at 9:43 PM Bossart, Nathan <bossartn@amazon.com> wrote:
>> Shouldn't we update the time in update_controlfile()?
>
> If you see the callers of update_controlfile() except for
> RewriteControlFile() no one else updates the timestamp before calling
> it, I am not sure if that is intentional or not. That was the one
> reason that was added in UpdateControlFile().  And another reason is
> that if you look at all the deleting lines followed by
> UpdateControlFile() & moving that to UpdateControlFile() wouldn't
> change anything drastically.
>
> IMO, anything going to change should update the timestamp as well,
> that could be a bug then.

I'm inclined to agree that anything that calls update_controlfile()
should update the timestamp.  However, I wonder if the additional
calls to time() would have a noticeable impact.

Nathan


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: 2021-09 Commitfest
Next
From: Jaime Casanova
Date:
Subject: Re: 2021-09 Commitfest