*
* XLogReader machinery is only able to handle records up to a certain
* size (ignoring machine resource limitations), so make sure that we will
- * not emit records larger than the sizes advertised to be supported. This
- * cap is based on DecodeXLogRecordRequiredSpace().
+ * not emit records larger than the sizes advertised to be supported.
*/
if (total_len > XLogRecordMaxSize)
ereport(ERROR,
/*
* Check that any records assembled can be decoded. This is capped based
- * on what XLogReader would require at its maximum bound. This code path
+ * on what XLogReader would require at its maximum bound. The XLOG_BLCKSZ
+ * addend covers the larger allocate_recordbuf() demand. This code path
* is called once per backend, more than enough for this check.
*/
- size_t max_required = DecodeXLogRecordRequiredSpace(XLogRecordMaxSize);
+ size_t max_required =
+ DecodeXLogRecordRequiredSpace(XLogRecordMaxSize + XLOG_BLCKSZ);
Assert(AllocSizeIsValid(max_required));
#endif
* in length if we ignore any allocation overhead of the XLogReader.
*
* To accommodate some overhead, this value allows for 4M of allocation
- * overhead, that should be plenty enough for what
- * DecodeXLogRecordRequiredSpace() expects as extra.
+ * overhead, that should be plenty enough for what the XLogReader
+ * infrastructure expects as extra.
*/
#define XLogRecordMaxSize (1020 * 1024 * 1024)