From c03a6ae220630c6d03dddf20789df62131ea6e9e Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 16 Apr 2014 10:21:09 +0300 Subject: [PATCH] Use correctly-sized buffer when zero-filling a WAL file. I mixed up BLCKSZ and XLOG_BLCKSZ when I changed the way the buffer is allocated a couple of weeks ago. With the default settings, they are both 8k, but they can be changed at compile-time. --- src/backend/access/transam/xlog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index ff19218f5b..9deadf9ed9 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -2247,7 +2247,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock) { char path[MAXPGPATH]; char tmppath[MAXPGPATH]; - char zbuffer_raw[BLCKSZ + MAXIMUM_ALIGNOF]; + char zbuffer_raw[XLOG_BLCKSZ + MAXIMUM_ALIGNOF]; char *zbuffer; XLogSegNo installed_segno; int max_advance; @@ -2307,7 +2307,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock) * cycles transferring data to the kernel. */ zbuffer = (char *) MAXALIGN(zbuffer_raw); - memset(zbuffer, 0, BLCKSZ); + memset(zbuffer, 0, XLOG_BLCKSZ); for (nbytes = 0; nbytes < XLogSegSize; nbytes += XLOG_BLCKSZ) { errno = 0; -- 2.40.0