Hi Andrey, On Sat, Nov 28, 2026 at 1:26 PM Andrey Borodin <[email protected]> wrote: > > > > > On 27 Nov 2026, at 17:27, Álvaro Herrera <[email protected]> wrote: > > > > Is this patch sufficient? I suspect not ... If not, I'm > > inclined to wrap the whole test in a SKIP block until a complete fix is > > developed. > > > > (There's also a 50_000 us timeout which is likely insufficient in slow > > machines ...) > > I think the main problem is relying on a sleep for synchronization. > On tamandua [0], the COPY backend itself was canceled before the second > cursor opened. What about using an injection point? > > The attached patch for master pauses the first reader when it receives > the conflict signal, while it still holds the pin. Only then does the > second reader connect. If it gets a buffer pin conflict, startup must > have sent the signal again. > With the old wait restored, the test fails at that check. With the fix > it passes locally with forced parallelism and beetle's log prefix. > > PG15 and PG16 lack injection points. I'd be fine with leaving this > test case disabled there...
I agree with your analysis. For these branches, I wonder if we could use SIGSTOP to pause the first reader so it cannot handle the conflict signal or release the pin. That being said, I'm not sure we need it since the whole 031 is skipped on v15/16. In my tests, v1 passed with the fix reverted: the startup progress timer woke the startup and caused another conflict signal. Fujii-san has a thread to disable this timeout during replay on HEAD. It hasn't landed yet, so we may still need to set the timeout to zero for now and stable branches. Could we wait for "User was holding shared buffer pin for too long" in the final check? It seems simpler. With the confl_bufferpin check, if the second reader is canceled during FETCH, it leaves the transaction aborted and does not update the shared stats, so it might times out even though the cancellation worked. I reproduced this by adding adding pg_sleep(3) to the second reader's cursor query; Attached is the perltidied v2 with those changes. -- Regards, Xuneng Zhou HighGo Software Co., Ltd.
v2-0001-Synchronize-the-standby-buffer-pin-conflict-test.patch
Description: Binary data
nocfbot-v2-0001-PG15-PG16-Synchronize-the-standby-buffer-pin-conflict-test.patch
Description: Binary data
nocfbot-v2-0001-PG18-Synchronize-the-standby-buffer-pin-conflict-test.patch
Description: Binary data
nocfbot-v2-0001-PG17-Synchronize-the-standby-buffer-pin-conflict-test.patch
Description: Binary data
