pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify determining logical replication worker types.
Date: Mon, 14 Aug 2023 03:15:13 +0000
Message-ID: <E1qVO2y-0000uE-Vc@gemulon.postgresql.org> (raw)

Simplify determining logical replication worker types.

We deduce a LogicalRepWorker's type from the values of several different
fields ('relid' and 'leader_pid') whenever logic needs to know it.

In fact, the logical replication worker type is already known at the time
of launching the LogicalRepWorker and it never changes for the lifetime of
that process. Instead of deducing the type, it is simpler to just store it
one time, and access it directly thereafter.

Author: Peter Smith
Reviewed-by: Amit Kapila, Bharath Rupireddy
Discussion: http://postgr.es/m/CAHut+PttPSuP0yoZ=9zLDXKqTJ=d0bhxwKaEaNcaym1XqcvDEg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2a8b40e3681921943a2989fd4ec6cdbf8766566c

Modified Files
--------------
.../replication/logical/applyparallelworker.c      |  3 ++-
src/backend/replication/logical/launcher.c         | 31 +++++++++++++++-------
src/backend/replication/logical/tablesync.c        |  3 ++-
src/include/replication/worker_internal.h          | 22 +++++++++++----
src/tools/pgindent/typedefs.list                   |  1 +
5 files changed, 43 insertions(+), 17 deletions(-)



Message-ID: <E1qVO2y-0000uE-Vc@gemulon.postgresql.org>
Permalink:  ../E1qVO2y-0000uE-Vc@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qVO2y-0000uE-Vc@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Simplify determining logical replication worker types.
  In-Reply-To: <E1qVO2y-0000uE-Vc@gemulon.postgresql.org>

* 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