mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
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.
This commit is contained in:
parent
3b8fda6763
commit
c03a6ae220
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user