On 09/03/2026 17:02, Xuneng Zhou wrote:
Did you use Alexander’s reproducer script? I tried reproducing with a
1 ms pg_usleep() added to all three functions that clear
MyProc->pendingRecoveryConflicts, but I still couldn’t reproduce the
issue.

I used the attached, to be precise. With that it fails every time for me. I'm not sure if the "if (am_walsender)" check is necessary, I added it just to make the test run faster.

- Heikki
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 0f913897acc..9fe62e2c2fe 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -653,6 +653,7 @@ ProcArrayRemove(PGPROC *proc, TransactionId latestXid)
 	LWLockRelease(ProcArrayLock);
 }
 
+extern bool am_walsender;
 
 /*
  * ProcArrayEndTransaction -- mark a transaction as no longer running
@@ -670,6 +671,8 @@ ProcArrayRemove(PGPROC *proc, TransactionId latestXid)
 void
 ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid)
 {
+	if (am_walsender)
+		pg_usleep(100000);
 	if (TransactionIdIsValid(latestXid))
 	{
 		/*

Reply via email to