BUG #3674: Unnecessary checkpoints by WAL Writer

Started by Itagaki Takahiroover 18 years ago3 messagesbugs
Jump to latest
#1Itagaki Takahiro
itagaki.takahiro@gmail.com

The following bug has been logged online:

Bug reference: 3674
Logged by: ITAGAKI Takahiro
Email address: itagaki.takahiro@gmail.com
PostgreSQL version: 8.3beta1
Operating system: independent
Description: Unnecessary checkpoints by WAL Writer
Details:

WAL Writer requests unnecessary checkpoints with CHECKPOINT_CAUSE_XLOG.
RedoRecPtr, declared in xlog.c, is initialized at StartupXLOG() but never
updated in WAL Writer because it never calls XLogInsert(). It judges excess
of segments wrongly.

Though bgwriter also does not call XLogInsert(), but it would be OK because
bgwriter updates RedoRecPtr in CreateCheckPoint().

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Itagaki Takahiro (#1)
Re: BUG #3674: Unnecessary checkpoints by WAL Writer

"ITAGAKI Takahiro" <itagaki.takahiro@gmail.com> writes:

WAL Writer requests unnecessary checkpoints with CHECKPOINT_CAUSE_XLOG.
RedoRecPtr, declared in xlog.c, is initialized at StartupXLOG() but never
updated in WAL Writer because it never calls XLogInsert(). It judges excess
of segments wrongly.

Good catch. I think the best fix for this is to make XLogWrite call
GetRedoRecPtr and recheck the condition before actually sending a
signal.

regards, tom lane

#3Simon Riggs
simon@2ndQuadrant.com
In reply to: Tom Lane (#2)
Re: BUG #3674: Unnecessary checkpoints by WAL Writer

On Fri, 2007-10-12 at 13:06 -0400, Tom Lane wrote:

"ITAGAKI Takahiro" <itagaki.takahiro@gmail.com> writes:

WAL Writer requests unnecessary checkpoints with CHECKPOINT_CAUSE_XLOG.
RedoRecPtr, declared in xlog.c, is initialized at StartupXLOG() but never
updated in WAL Writer because it never calls XLogInsert(). It judges excess
of segments wrongly.

Good catch. I think the best fix for this is to make XLogWrite call
GetRedoRecPtr and recheck the condition before actually sending a
signal.

Yes, very good catch, my bad. Thanks Itagaki.

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com