Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59af8d4

Browse files
Pad XLogReaderState's per-buffer data_bufsz more aggressively.
Originally, we palloc'd this buffer just barely big enough to hold thelargest xlog backup block seen so far. We now MAXALIGN the palloc size.The original coding could result in many repeated palloc cycles, in theworst case where we see a series ofgradually larger xlog records. Weameliorate that similarly to8735978by imposing a minimum buffer size of BLCKSZ.Discussion:https://postgr.es/m/E1eHa4J-0006hI-Q8@gemulon.postgresql.org
1 parentd5f965c commit59af8d4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/backend/access/transam/xlogreader.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,13 @@ DecodeXLogRecord(XLogReaderState *state, XLogRecord *record, char **errormsg)
12641264
{
12651265
if (blk->data)
12661266
pfree(blk->data);
1267-
blk->data_bufsz=blk->data_len;
1267+
1268+
/*
1269+
* Force the initial request to be BLCKSZ so that we don't
1270+
* waste time with lots of trips through this stanza as a
1271+
* result of WAL compression.
1272+
*/
1273+
blk->data_bufsz=MAXALIGN(Max(blk->data_len,BLCKSZ));
12681274
blk->data=palloc(blk->data_bufsz);
12691275
}
12701276
memcpy(blk->data,ptr,blk->data_len);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp