Pad XLogReaderState's per-buffer data_bufsz more aggressively.

Simon Riggs <simon@2ndQuadrant.com>

Commit: 59af8d4384ba5ae72986eab7e5cdc514a969aa05
Author: Simon Riggs <simon@2ndQuadrant.com>
Date: 2017-11-27T09:34:05Z
Releases: 11.0
Pad XLogReaderState's per-buffer data_bufsz more aggressively.

Originally, we palloc'd this buffer just barely big enough to hold the
largest xlog backup block seen so far. We now MAXALIGN the palloc size.

The original coding could result in many repeated palloc cycles, in the
worst case where we see a series ofgradually larger xlog records.  We
ameliorate that similarly to 8735978e7aebfbc499843630131c18d1f7346c79
by imposing a minimum buffer size of BLCKSZ.

Discussion: https://postgr.es/m/E1eHa4J-0006hI-Q8@gemulon.postgresql.org

Files

PathChange+/−
src/backend/access/transam/xlogreader.c modified +7 −1

Discussion

Cited messages not in the archive: E1eHa4J-0006hI-Q8@gemulon.postgresql.org