Rework handling of OOM when allocating record buffer in XLOG reader.

Fujii Masao <fujii@postgresql.org>

Commit: 9b8d4782ba0f75eb0f029c743bb85166999d9fa5
Author: Fujii Masao <fujii@postgresql.org>
Date: 2015-04-03T09:29:38Z
Releases: 9.5.0
Rework handling of OOM when allocating record buffer in XLOG reader.

Commit 2c03216 changed allocate_recordbuf() so that it uses a palloc to
allocate the read buffer and fails immediately when an out-of-memory error
shows up, even though its callers still expect that NULL is returned in that
case. This bug is fixed making allocate_recordbuf() use a palloc_extended
with MCXT_ALLOC_NO_OOM flag and return NULL in OOM case.

Michael Paquier

Files

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