A couple of spots can benefit from an added errdetail(), which matches
what we were already doing in other places; and those that cannot
withstand errdetail() can get a more descriptive primary message.
Author: Bharath Rupireddy <
[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Reviewed-by: Julien Rouhaud <[email protected]>
Discussion: https://postgr.es/m/CALj2ACV+cX1eM03GfcA=ZMLXh5fSn1X1auJLz3yuS1duPSb9QA@mail.gmail.com
if (!debug_reader)
{
- appendStringInfoString(&buf, "error decoding record: out of memory");
+ appendStringInfoString(&buf, "error decoding record: out of memory while allocating a WAL reading processor");
}
else if (!DecodeXLogRecord(debug_reader, (XLogRecord *) recordBuf.data,
&errormsg))
if (!ctx->reader)
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
- errmsg("out of memory")));
+ errmsg("out of memory"),
+ errdetail("Failed while allocating a WAL reading processor.")));
ctx->reorder = ReorderBufferAllocate();
ctx->snapshot_builder =
if (!xlogreader)
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
- errmsg("out of memory")));
+ errmsg("out of memory"),
+ errdetail("Failed while allocating a WAL reading processor.")));
/*
* We assume here that we're logging enough information in the WAL for
XL_ROUTINE(.page_read = &SimpleXLogPageRead),
&private);
if (xlogreader == NULL)
- pg_fatal("out of memory");
+ pg_fatal("out of memory while allocating a WAL reading processor");
XLogBeginRead(xlogreader, startpoint);
do
XL_ROUTINE(.page_read = &SimpleXLogPageRead),
&private);
if (xlogreader == NULL)
- pg_fatal("out of memory");
+ pg_fatal("out of memory while allocating a WAL reading processor");
XLogBeginRead(xlogreader, ptr);
record = XLogReadRecord(xlogreader, &errormsg);
XL_ROUTINE(.page_read = &SimpleXLogPageRead),
&private);
if (xlogreader == NULL)
- pg_fatal("out of memory");
+ pg_fatal("out of memory while allocating a WAL reading processor");
searchptr = forkptr;
for (;;)
.segment_close = WALDumpCloseSegment),
&private);
if (!xlogreader_state)
- fatal_error("out of memory");
+ fatal_error("out of memory while allocating a WAL reading processor");
/* first find a valid recptr to start from */
first_record = XLogFindNextRecord(xlogreader_state, private.startptr);