File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Original file line number Diff line number Diff line change @@ -897,8 +897,7 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
897
897
*
898
898
* XLogReader machinery is only able to handle records up to a certain
899
899
* size (ignoring machine resource limitations), so make sure that we will
900
- * not emit records larger than the sizes advertised to be supported. This
901
- * cap is based on DecodeXLogRecordRequiredSpace().
900
+ * not emit records larger than the sizes advertised to be supported.
902
901
*/
903
902
if (total_len > XLogRecordMaxSize )
904
903
ereport (ERROR ,
@@ -1339,10 +1338,12 @@ InitXLogInsert(void)
1339
1338
1340
1339
/*
1341
1340
* Check that any records assembled can be decoded. This is capped based
1342
- * on what XLogReader would require at its maximum bound. This code path
1341
+ * on what XLogReader would require at its maximum bound. The XLOG_BLCKSZ
1342
+ * addend covers the larger allocate_recordbuf() demand. This code path
1343
1343
* is called once per backend, more than enough for this check.
1344
1344
*/
1345
- size_t max_required = DecodeXLogRecordRequiredSpace (XLogRecordMaxSize );
1345
+ size_t max_required =
1346
+ DecodeXLogRecordRequiredSpace (XLogRecordMaxSize + XLOG_BLCKSZ );
1346
1347
1347
1348
Assert (AllocSizeIsValid (max_required ));
1348
1349
#endif
Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ typedef struct XLogRecord
68
68
* in length if we ignore any allocation overhead of the XLogReader.
69
69
*
70
70
* To accommodate some overhead, this value allows for 4M of allocation
71
- * overhead, that should be plenty enough for what
72
- * DecodeXLogRecordRequiredSpace() expects as extra.
71
+ * overhead, that should be plenty enough for what the XLogReader
72
+ * infrastructure expects as extra.
73
73
*/
74
74
#define XLogRecordMaxSize (1020 * 1024 * 1024)
75
75
You can’t perform that action at this time.
0 commit comments