Re: archive_timeout behaviour when archive_mode is off (was Re: Too frequent checkpoints ?)

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: archive_timeout behaviour when archive_mode is off (was Re: Too frequent checkpoints ?)
Date: 2013-02-15 17:43:12
Message-ID: CAHGQGwG-orfQdWemWGi=zNCgtm_XeV__Z4obf0O6T17VVZDC4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 15, 2013 at 3:12 PM, Pavan Deolasee
<pavan(dot)deolasee(at)gmail(dot)com> wrote:
> (changing subject)
>
> On Thu, Feb 14, 2013 at 11:48 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> On Mon, Feb 11, 2013 at 5:46 PM, Pavan Deolasee
>>> I also noticed that the WAL file switch
>>> happens after archive_timeout seconds irrespective of whether
>>> archive_mode is turned ON or not. This happens because we don't check
>>> if XLogArchivingActive() in CheckArchiveTimeout() function. It looks
>>> wrong to me.
>>
>> +1 to fix this. I've not heard the use case where archive_timeout needs to
>> be used even in not archive mode...
>
> Ok, I will write a patch to fix this. I wonder if this is worth
> backpatching though. The code is like that for a long time and the
> fact that we haven't heard any complaints about it, may be its not
> worth fixing in the stable branches. But I wonder if anyone else
> thinks otherwise.

On second thought, there might be the use case. Imagine the case where
you disable archive_mode and instead use pg_receivexlog for WAL archiving
purpose. WAL records are streamed from the server to pg_receivexlog in
realtime, so basically archive_timeout is not required to be set in this case.
But you might need to periodically verify the correctness of the connection
between the server and pg_receivexlog. You can do that by checking whether
new WAL file has been streamed since last check. But if there is no activity
in the server, you cannot use that verification method. In this case,
archive_timeout is useful even when archive_mode is not enabled.

This is very narrow case, but as you said, we haven't heard any complaints
about it, so I'm inclined not to fix it....

Regards,

--
Fujii Masao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-02-15 17:44:30 Re: Materialized views WIP patch
Previous Message Heikki Linnakangas 2013-02-15 17:43:08 Re: Unarchived WALs deleted after crash