Ensure that WAL pages skipped by a forced WAL switch are zero-filled.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Mar 2018 20:18:18 +0000 (16:18 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Mar 2018 20:18:18 +0000 (16:18 -0400)
commit4a33bb59dfc33566f04e18ab5e1f90b8e7461052
tree63d31724fafc6bc9c473539e4ba81000f5dabd64
parente5eb4fa87331821423b362be5ea4b18e873d5b27
Ensure that WAL pages skipped by a forced WAL switch are zero-filled.

In the previous coding, skipped pages were mostly zeroes, but they still
had valid WAL page headers.  That makes them very much less compressible
than an unbroken string of zeroes would be --- about 10X worse for bzip2
compression, for instance.  We don't need those headers, so tweak the logic
so that we zero them out.

Chapman Flack, reviewed by Daniel Gustafsson

Discussion: https://postgr.es/m/579297F8.7020107@anastigmatix.net
src/backend/access/transam/xlog.c