Avoid edge case in pg_visibility test with small shared_buffers
authorAndres Freund <[email protected]>
Tue, 26 Mar 2024 02:58:10 +0000 (19:58 -0700)
committerAndres Freund <[email protected]>
Tue, 26 Mar 2024 03:19:43 +0000 (20:19 -0700)
Since 82a4edabd27 we can bulk extend relations. The bulk relation extension
logic has a heuristic component. Normally the heurstic does not trigger in the
occasionally-failing test case, as the relation is only extended once. But
with very small shared_buffers the limits for the number of buffers pinned at
once prevent the extension from happening at once. With the second "bulk"
extension, the heuristic kicks in, and the relation ends up one block bigger.
That's ok from a correctness perspective, but changes the results of the test
query due to one additional block.

We discussed a few more expansive fixes, but for now have decided to avoid
this by making the table a bit smaller.

Author: Heikki Linnakangas <[email protected]>
Reported-by:
Discussion: https://postgr.es/m/29c74104-210b-ef39-2522-27a6aa7a704f@iki.fi
Discussion: https://postgr.es/m/20230916000011[email protected]
Backpatch: 16-, where the new relation extension logic was added

contrib/pg_visibility/expected/pg_visibility.out
contrib/pg_visibility/sql/pg_visibility.sql

index 9de54db2a29247dd67bb8570279a458f06c4c4e4..09fa5933a35b29d2847a31943546b012a18c409d 100644 (file)
@@ -217,8 +217,7 @@ select * from pg_visibility_map('copyfreeze');
 -------+-------------+------------
      0 | t           | t
      1 | t           | t
-     2 | t           | t
-(3 rows)
+(2 rows)
 
 select * from pg_check_frozen('copyfreeze');
  t_ctid 
index ff3538f9964a127225e820ea02510cca07ac2751..5af06ec5b76008efbf823440567bb72078a41f85 100644 (file)
@@ -108,12 +108,6 @@ copy copyfreeze from stdin freeze;
 4  '4'
 5  '5'
 6  '6'
-7  '7'
-8  '8'
-9  '9'
-10 '10'
-11 '11'
-12 '12'
 \.
 commit;
 select * from pg_visibility_map('copyfreeze');