In standby mode, respect checkpoint_segments in addition to
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 9 Jun 2010 15:04:07 +0000 (15:04 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 9 Jun 2010 15:04:07 +0000 (15:04 +0000)
commit71815306e9e1ba7e95752779d2ad51d0c2b9c747
treecc8f73383bf338d405324e5abfc2e612b2ffaab2
parent8c873bbfa723e4d035847a488adbd0aa21c595b9
In standby mode, respect checkpoint_segments in addition to
checkpoint_timeout to trigger restartpoints. We used to deliberately only
do time-based restartpoints, because if checkpoint_segments is small we
would spend time doing restartpoints more often than really necessary.
But now that restartpoints are done in bgwriter, they're not as
disruptive as they used to be. Secondly, because streaming replication
stores the streamed WAL files in pg_xlog, we want to clean it up more
often to avoid running out of disk space when checkpoint_timeout is large
and checkpoint_segments small.

Patch by Fujii Masao, with some minor changes by me.
src/backend/access/transam/xlog.c
src/backend/replication/walreceiver.c