public inbox for [email protected]  
help / color / mirror / Atom feed
From: Amit Kapila <[email protected]>
To: [email protected]
Subject: pgsql: Avoid invalidating all RelationSyncCache entries on publication
Date: Thu, 13 Mar 2025 04:00:15 +0000
Message-ID: <[email protected]> (raw)

Avoid invalidating all RelationSyncCache entries on publication rename.

On Publication rename, we need to only invalidate the RelationSyncCache
entries corresponding to relations that are part of the publication being
renamed.

As part of this patch, we introduce a new invalidation message to
invalidate the cache maintained by the logical decoding output plugin. We
can't use existing relcache invalidation for this purpose, as that would
unnecessarily cause relcache invalidations in other backends.

This will improve performance by building fewer relation cache entries
during logical replication.

Author: Hayato Kuroda <[email protected]>
Author: Shlok Kyal <[email protected]>
Reviewed-by: Hou Zhijie <[email protected]>
Reviewed-by: Amit Kapila <[email protected]>
Discussion: https://postgr.es/m/OSCPR01MB14966C09AA201EFFA706576A7F5C92@OSCPR01MB14966.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3abe9dc18892b9f69bb48a2eb21fbe5cf348a489

Modified Files
--------------
src/backend/access/rmgrdesc/standbydesc.c   |   2 +
src/backend/commands/alter.c                |  16 ++++
src/backend/commands/publicationcmds.c      |  39 +++++++++
src/backend/replication/pgoutput/pgoutput.c |   8 +-
src/backend/utils/cache/inval.c             | 125 ++++++++++++++++++++++++++++
src/include/commands/publicationcmds.h      |   1 +
src/include/pg_config_manual.h              |   8 +-
src/include/storage/sinval.h                |  24 ++++--
src/include/utils/inval.h                   |  10 +++
src/test/subscription/t/007_ddl.pl          |  85 +++++++++++++++++++
10 files changed, 302 insertions(+), 16 deletions(-)



view thread (5+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Avoid invalidating all RelationSyncCache entries on publication
  In-Reply-To: <[email protected]>

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

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