From 1a769d25e8d8b4369e64c4e00941bfe06843bd08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafael=20Chac=C3=B3n?= <rafael.chacon@supabase.io>
Date: Mon, 9 Nov 2026 09:57:16 -0500
Subject: [PATCH] Add tablesync slot drop injection points

Add injection points before and after the tablesync worker asks the
publisher to drop its replication slot, so tests can stop a worker at
that point (for example to simulate a subscriber crash there).
---
 src/backend/commands/subscriptioncmds.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index ce45f7e16d4..e91a4f2d911 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -2933,10 +2933,13 @@ ReplicationSlotDropAtPubNode(WalReceiverConn *wrconn, char *slotname, bool missi
 	{
 		WalRcvExecResult *res;
 
+		INJECTION_POINT("tablesync-before-source-slot-drop", NULL);
 		res = walrcv_exec(wrconn, cmd.data, 0, NULL);
 
 		if (res->status == WALRCV_OK_COMMAND)
 		{
+			INJECTION_POINT("tablesync-after-source-slot-drop", NULL);
+
 			/* NOTICE. Success. */
 			ereport(NOTICE,
 					(errmsg("dropped replication slot \"%s\" on publisher",
-- 
2.54.0 (Apple Git-157)

