Hi,

I tried to apply this patch v5 to current master branch but it complains,
"git apply --check v5-0001-Add-protections-in-xlog-record-APIs-against-large.patch
error: patch failed: src/include/access/xloginsert.h:43
error: src/include/access/xloginsert.h: patch does not apply"

then I checked it out before the commit `b0a55e43299c4ea2a9a8c757f9c26352407d0ccc` and applied this v5 patch.

1) both make check and make installcheck passed.

2) and I can also see this patch v5 prevents the error happens previously,

"postgres=# SELECT pg_logical_emit_message(false, long, long) FROM repeat(repeat(' ', 1024), 1024*1023) as l(long);
ERROR:  too much WAL data"

3) without this v5 patch, the same test will cause the standby crash like below, and the standby not be able to boot up after this crash.

"2022-07-08 12:28:16.425 PDT [2363] FATAL:  invalid memory alloc request size 2145388995 2022-07-08 12:28:16.426 PDT [2360] LOG:  startup process (PID 2363) exited with exit code 1 2022-07-08 12:28:16.426 PDT [2360] LOG:  terminating any other active server processes 2022-07-08 12:28:16.427 PDT [2360] LOG:  shutting down due to startup process failure
2022-07-08 12:28:16.428 PDT [2360] LOG:  database system is shut down"


Best regards,

--
David

Software Engineer
Highgo Software Inc. (Canada)
www.highgo.ca


Reply via email to