v8-0001-Don-t-start-launcher-process-in-binary-upgrade-mo.patch

text/x-patch

Filename: v8-0001-Don-t-start-launcher-process-in-binary-upgrade-mo.patch
Type: text/x-patch
Part: 0
Message: Re: pg_upgrade and logical replication

Patch

Format: format-patch
Series: patch v8-0001
Subject: Don't start launcher process in binary upgrade mode.
File+
src/backend/replication/logical/launcher.c 8 0
From 84dff766b98381dafd7382b7521107a9f76608dd Mon Sep 17 00:00:00 2001
From: Vignesh C <vignesh21@gmail.com>
Date: Thu, 14 Sep 2023 09:59:46 +0530
Subject: [PATCH v8 1/3] Don't start launcher process in binary upgrade mode.

We don't want launcher to run in binary upgrade mode because
launcher might start apply worker which will start receiving changes
from the publisher and update the old cluster before the upgradation
is completed.
---
 src/backend/replication/logical/launcher.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c
index 7882fc91ce..ec8cfd40ef 100644
--- a/src/backend/replication/logical/launcher.c
+++ b/src/backend/replication/logical/launcher.c
@@ -925,6 +925,14 @@ ApplyLauncherRegister(void)
 {
 	BackgroundWorker bgw;
 
+	/*
+	 * We don't want launcher to run in binary upgrade mode because
+	 * launcher might start apply worker which will start receiving changes
+	 * from the publisher before the physical files are put in place.
+	 */
+	if (IsBinaryUpgrade)
+		return;
+
 	if (max_logical_replication_workers == 0)
 		return;
 
-- 
2.34.1