Skip to content

Commit 848b9f0

Browse files
committed
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.
1 parent ab76d8e commit 848b9f0

File tree

1 file changed

+2
-2
lines changed
  • src/backend/access/transam

1 file changed

+2
-2
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,7 +3079,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
30793079
{
30803080
char path[MAXPGPATH];
30813081
char tmppath[MAXPGPATH];
3082-
char zbuffer_raw[BLCKSZ + MAXIMUM_ALIGNOF];
3082+
char zbuffer_raw[XLOG_BLCKSZ + MAXIMUM_ALIGNOF];
30833083
char *zbuffer;
30843084
XLogSegNo installed_segno;
30853085
int max_advance;
@@ -3139,7 +3139,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
31393139
* cycles transferring data to the kernel.
31403140
*/
31413141
zbuffer = (char *) MAXALIGN(zbuffer_raw);
3142-
memset(zbuffer, 0, BLCKSZ);
3142+
memset(zbuffer, 0, XLOG_BLCKSZ);
31433143
for (nbytes = 0; nbytes < XLogSegSize; nbytes += XLOG_BLCKSZ)
31443144
{
31453145
errno = 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy