Skip to content

Commit c36b636

Browse files
committed
Fix off-by-one in XLogRecordMaxSize check.
pg_logical_emit_message(false, '_', repeat('x', 1069547465)) failed with self-contradictory message "WAL record would be 1069547520 bytes (of maximum 1069547520 bytes)". There's no particular benefit from allowing or denying one byte in either direction; XLogRecordMaxSize could rise a few megabytes without trouble. Hence, this is just for cleanliness. Back-patch to v16, where this check first appeared.
1 parent 638d42a commit c36b636

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/transam/xloginsert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
900900
* not emit records larger than the sizes advertised to be supported. This
901901
* cap is based on DecodeXLogRecordRequiredSpace().
902902
*/
903-
if (total_len >= XLogRecordMaxSize)
903+
if (total_len > XLogRecordMaxSize)
904904
ereport(ERROR,
905905
(errmsg_internal("oversized WAL record"),
906906
errdetail_internal("WAL record would be %llu bytes (of maximum %u bytes); rmid %u flags %u.",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy