Skip to content

Commit 8c0caca

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 969735c commit 8c0caca

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
@@ -2167,7 +2167,7 @@ XLogFileInit(uint32 log, uint32 seg,
21672167
{
21682168
char path[MAXPGPATH];
21692169
char tmppath[MAXPGPATH];
2170-
char zbuffer_raw[BLCKSZ + MAXIMUM_ALIGNOF];
2170+
char zbuffer_raw[XLOG_BLCKSZ + MAXIMUM_ALIGNOF];
21712171
char *zbuffer;
21722172
uint32 installed_log;
21732173
uint32 installed_seg;
@@ -2229,7 +2229,7 @@ XLogFileInit(uint32 log, uint32 seg,
22292229
* cycles transferring data to the kernel.
22302230
*/
22312231
zbuffer = (char *) MAXALIGN(zbuffer_raw);
2232-
memset(zbuffer, 0, BLCKSZ);
2232+
memset(zbuffer, 0, XLOG_BLCKSZ);
22332233
for (nbytes = 0; nbytes < XLogSegSize; nbytes += XLOG_BLCKSZ)
22342234
{
22352235
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