pgsql: Rework handling of OOM when allocating record buffer in XLOG rea

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Rework handling of OOM when allocating record buffer in XLOG rea
Date: 2015-04-03 09:30:02
Message-ID: E1YdxvO-0002eX-7N@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9b8d4782ba0f75eb0f029c743bb85166999d9fa5

Modified Files
--------------
src/backend/access/transam/xlogreader.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2015-04-03 12:48:46 pgsql: Change the way we decide whether to give up on abbreviated text
Previous Message Fujii Masao 2015-04-03 08:36:47 pgsql: Add palloc_extended for frontend and backend.