Re: Logical replication 'ERROR: invalid memory alloc request size 1831213792' after upgrading to 15.13

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Braulio Fdo Gonzalez <brauliofg(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical replication 'ERROR: invalid memory alloc request size 1831213792' after upgrading to 15.13
Date: 2025-06-17 17:45:15
Message-ID: CAD21AoAxMphCg9xUVj+o6ot+0b24xWBwTFjkYrLn_kgFozShPA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jun 9, 2025 at 7:09 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> Dear Braulio,
>
> > Hi, I'm having the issue with PG 15.13. We tried adding more memory
> > (logical_decoding_work_mem) to 5 GB, but it still doesn't work, and the process
> > "replicate" stops with the following error:
> > "CDC Fetch Failed: An unexpected connection error occurred while attempting to
> > replicate data from the source. Make sure your connection profile settings are
> > correct. If the problem persists, contact Google Support."
> > "ERROR: Invalid memory allocation request, size 1674007328."
> > We have another environment with PG 15.12, and it works perfectly.
> > This case has have relation with https://www.postgresql.org/message-id/CALDaNm2sGfKsZwm8rG132N_i0AvyxkYu8TL46kNcx7KwAUABxA%40mail.gmail.com
>
> Thanks for reporting. Yes, I also feel that you faced the same issue. Since the
> issue happens lower layer than the logical decoding, logical_decoding_work_mem
> can't work to avoid the ERROR. We are discussing how we fix.

And I pushed the fix for this issue[1].

Regards,

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d87d07b7ad3b782cb74566cd771ecdb2823adf6a

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurence Parry 2025-06-17 20:10:07 Re: BUG #18942: walsender memory allocation failure adding snapshot and invalidations to logical replica w/PG 16.9
Previous Message Masahiko Sawada 2025-06-17 17:42:41 Re: [E] Re: BUG #18938: Logical replication failure in 16.9: "invalid memory alloc request size 1372786672"