Re: Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5
vignesh C <vignesh21@gmail.com>
From: vignesh C <vignesh21@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Duncan Sands <duncan.sands@deepbluecap.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-06-05T10:28:30Z
Lists: pgsql-bugs
Attachments
- v11-master-0001-Fix-exponential-memory-allocation-issue-i.patch (text/x-patch) patch v11-0001
On Thu, 5 Jun 2025 at 03:19, Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > Thank you for updating the patch. I have some comments and questions: > > In ReorderBufferAbort(): > > /* > * We might have decoded changes for this transaction that could load > * the cache as per the current transaction's view (consider DDL's > * happened in this transaction). We don't want the decoding of future > * transactions to use those cache entries so execute invalidations. > */ > if (txn->ninvalidations > 0) > ReorderBufferImmediateInvalidation(rb, txn->ninvalidations, > txn->invalidations); > > I think that if the txn->invalidations_distributed is overflowed, we > would miss executing the txn->invalidations here. Probably the same is > true for ReorderBufferForget() and ReorderBufferInvalidate(). I'm accumulating the invalidations in txn->invalidations irrespective of RBTXN_INVAL_OVERFLOWED txn. > --- > I'd like to make it clear again which case we need to execute > txn->invalidations as well as txn->invalidations_distributed (like in > ReorderBufferProcessTXN()) and which case we need to execute only > txn->invalidations (like in ReorderBufferForget() and > ReorderBufferAbort()). I think it might be worth putting some comments > about overall strategy somewhere. I have added comments for this, feel free to reword it if some changes are required. The attached v11 version patch has the changes for the same. Regards, Vignesh
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix cache-dependent test failures in logical decoding.
- 87819f766f37 13.22 landed
-
Fix re-distributing previously distributed invalidation messages during logical decoding.
- d87d07b7ad3b 18.0 landed
- 45c357e0e85d 17.6 landed
- b2ae077205e1 16.10 landed
- fc0fb77c550f 15.14 landed
- 983b3636259b 14.19 landed
- 1230be12f086 13.22 landed
-
Fix data loss in logical replication.
- 247ee94150b6 13.21 cited
- 4909b38af034 18.0 cited