From 4d4c0f4f44249ffe1b05841442182fdeb23a2037 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
Date: Thu, 13 Aug 2026 13:11:43 +0900
Subject: [PATCH v3 2/2] Add new string-based wait in
 051_effective_wal_level.pl

Attach the "replication-slot-create-begin" wait with a slot name to
target a specific slot, rather than any slot creation to reach the
point.  Serves as an in-tree example of the condition-string API.
---
 src/backend/replication/slot.c                 | 2 +-
 src/test/recovery/t/051_effective_wal_level.pl | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 1a0ff682068..63ce6d27885 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -420,7 +420,7 @@ ReplicationSlotCreate(const char *name, bool db_specific,
 					errmsg("cannot enable failover for a temporary replication slot"));
 	}
 
-	INJECTION_POINT("replication-slot-create-begin", NULL);
+	INJECTION_POINT("replication-slot-create-begin", (char *) name);
 
 	/*
 	 * If some other backend ran this code concurrently with us, we'd likely
diff --git a/src/test/recovery/t/051_effective_wal_level.pl b/src/test/recovery/t/051_effective_wal_level.pl
index 11bf4cb6134..602be5d55f0 100644
--- a/src/test/recovery/t/051_effective_wal_level.pl
+++ b/src/test/recovery/t/051_effective_wal_level.pl
@@ -569,7 +569,7 @@ hot_standby_feedback = on
 		qr/sync_slots/,
 		q(\echo sync_slots
 select injection_points_set_local();
-select injection_points_attach('replication-slot-create-begin', 'wait');
+select injection_points_attach('replication-slot-create-begin', 'wait', 'sync_slot');
 select pg_sync_replication_slots();
 ));
 	$standby5->wait_for_event('client backend',
@@ -622,7 +622,7 @@ select pg_sync_replication_slots();
 		qr/create_standby5_slot/,
 		q(\echo create_standby5_slot
 select injection_points_set_local();
-select injection_points_attach('replication-slot-create-begin', 'wait');
+select injection_points_attach('replication-slot-create-begin', 'wait', 'standby5_slot');
 select pg_create_logical_replication_slot('standby5_slot', 'test_decoding');
 ));
 	$standby5->wait_for_event('client backend',
-- 
2.47.3

