On Mon, Aug 7, 2023 at 7:21 AM Konstantin Knizhnik <knizh...@garret.ru> wrote: > Two tests are failed because of sync scan - this tests cluster.sql and > portals.sql perform seqscan without explicit order by and expect that > data will be returned in particular order. But because of sync scan it > doesn't happen. Small shared buffers are needed to satisfy seqscan > criteria in heapam.c: `scan->rs_nblocks > NBuffers / 4` for tenk1 table.
I wondered the same thing while working on the tests in commit 8ab0ebb9a84, which explicitly care about physical order, so they *say so* with ORDER BY ctid. But the problem seems quite widespread, so I didn't volunteer to try to do something like that everywhere, when Tom committed cbf4177f for 027_stream_regress.pl. FWIW here's another discussion of that cluster test, in which I was still figuring out some surprising ways this feature can introduce non-determinism even without concurrent access to the same table. https://www.postgresql.org/message-id/flat/CA%2BhUKGLTK6ZuEkpeJ05-MEmvmgZveCh%2B_w013m7%2ByKWFSmRcDA%40mail.gmail.com