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: Reset the logical worker type while cleaning up other worker inf
Date: Fri, 25 Aug 2023 03:36:49 +0000
Message-ID: <E1qZNcv-000laq-EX@gemulon.postgresql.org> (raw)

Reset the logical worker type while cleaning up other worker info.

Commit 2a8b40e36 introduces the worker type field for logical replication
workers, but forgot to reset the type when the worker exits. This can lead
to recognizing a stopped worker as a valid logical replication worker.

Fix it by resetting the worker type and additionally adding the safeguard
to not use LogicalRepWorker until ->in_use is verified.

Reported-by: Thomas Munro based on cfbot reports.
Author: Hou Zhijie, Alvaro Herrera
Reviewed-by: Amit Kapila
Discussion: http://postgr.es/m/CA+hUKGK2RQh4LifVgBmkHsCYChP-65UwGXOmnCzYVa5aAt4GWg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9c13b6814ac7943036c64b377675184b243f04e8

Modified Files
--------------
src/backend/replication/logical/launcher.c | 5 +++--
src/include/replication/worker_internal.h  | 8 ++++++--
2 files changed, 9 insertions(+), 4 deletions(-)



Message-ID: <E1qZNcv-000laq-EX@gemulon.postgresql.org>
Permalink:  ../E1qZNcv-000laq-EX@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qZNcv-000laq-EX@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: Reset the logical worker type while cleaning up other worker inf
  In-Reply-To: <E1qZNcv-000laq-EX@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