Обсуждение: archive_timeout behaviour when archive_mode is off (was Re: Too frequent checkpoints ?)
archive_timeout behaviour when archive_mode is off (was Re: Too frequent checkpoints ?)
От
Pavan Deolasee
Дата:
(changing subject) On Thu, Feb 14, 2013 at 11:48 PM, Fujii Masao <masao.fujii@gmail.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. I think we should also update the documentation to be clear that archive_timeout and archive_command are used only when archive_mode is turned on. Thanks, Pavan -- Pavan Deolasee http://www.linkedin.com/in/pavandeolasee
On Fri, Feb 15, 2013 at 3:12 PM, Pavan Deolasee <pavan.deolasee@gmail.com> wrote: > (changing subject) > > On Thu, Feb 14, 2013 at 11:48 PM, Fujii Masao <masao.fujii@gmail.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