Hi,
I reviewed v2. The bug is real on master and v2 fixes it. With
Dmytro's steps, master never cancels the cursor session. With v2 it
gets FATAL about one second after it takes the pin.
I had a few small comments, so I just made the changes. v3 is
attached.
- It calls WaitLatch directly in standby.c, so proc.c and proc.h are
not touched. That should be easier to backpatch.
- The comment no longer names PROCSIG_RECOVERY_CONFLICT_BUFFERPIN,
which is gone since 17f51ea8187.
- The 1s is a define now, and the commit message is shorter.
The patch in [1] rewrites the same wait as a loop, so the two do not
apply together. Its expired path still sleeps with no timeout, so
this fix is still needed after it.