pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
To: vignesh C <vignesh21@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Duncan Sands <duncan.sands@deepbluecap.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: RE: Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5
Date: Wed, 11 Jun 2025 01:45:19 +0000
Message-ID: <OSCPR01MB14966C14006CDF9FB0CC151B4F575A@OSCPR01MB14966.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CALDaNm0TaTPuza7Fa+DRMzL+mqK3+7RVEvFiRoDJbU2vkJESwg@mail.gmail.com>
References: <CALDaNm0DkWbr8eA3kAkEw+cZA-n=KPmFxZ_5bz_YDqhYQGk6iA@mail.gmail.com>
	<CALDaNm0TaTPuza7Fa+DRMzL+mqK3+7RVEvFiRoDJbU2vkJESwg@mail.gmail.com>

Dear hackers,

> Attached are the patches, including those required for the back branches.

While reviewing patch for PG13, I found the doubtful point in ReorderBufferCommit().

```
            /*
             * Every time the CommandId is incremented, we could
             * see new catalog contents, so execute all
             * invalidations.
             */
            ReorderBufferExecuteInvalidations(txn->ninvalidations,
                              txn->invalidations);
```

This is called when REORDER_BUFFER_CHANGE_INTERNAL_COMMAND_ID is dequeued from the
change queue, and this part exists only in PG13 codebase.
We are not sure whether we should execute txn->invalidations_distributed as well.
This can affect below case:


txn1: BEGIN; INSERT INTO d VALUES ('d1');
txn2: ALTER PUBLICATION pb ADD TABLE d;
txn1: CREATE TABLE another (id int);
txn1: INSERT INTO d VALUES ('d2');
txn1: COMMIT;
  -> PG13                                          - no output
  -> PG13 + v13 patch                              - no output
  -> PG13 + v13 patch + additional inval execution - d2 can be replicated
  -> (master - d2 can be replicated)

Personally I think txn->invalidations_distributed is not needed to be executed
because the spec seems bit complex,  but I want to know other opinion.

Best regards,
Hayato Kuroda
FUJITSU LIMITED



view thread (94+ messages)  latest in thread

Message-ID: <OSCPR01MB14966C14006CDF9FB0CC151B4F575A@OSCPR01MB14966.jpnprd01.prod.outlook.com>
Permalink:  ../OSCPR01MB14966C14006CDF9FB0CC151B4F575A@OSCPR01MB14966.jpnprd01.prod.outlook.com/
Also on:    postgresql.org/message-id/OSCPR01MB14966C14006CDF9FB0CC151B4F575A@OSCPR01MB14966.jpnprd01.prod.outlook.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: kuroda.hayato@fujitsu.com, vignesh21@gmail.com, sawada.mshk@gmail.com, amit.kapila16@gmail.com, duncan.sands@deepbluecap.com, pgsql-bugs@lists.postgresql.org
  Subject: RE: Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5
  In-Reply-To: <OSCPR01MB14966C14006CDF9FB0CC151B4F575A@OSCPR01MB14966.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox