summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund2024-03-26 02:58:10 +0000
committerAndres Freund2024-03-26 03:19:43 +0000
commit3a4837fc809a8656374959049f3ac7a09a711334 (patch)
treeca2cf45a8d6d8aae0136d01b1ae982b43bc0b269
parent41d3780d3d29acd7e0a7a6922f2757243e9186d0 (diff)
Avoid edge case in pg_visibility test with small shared_buffers
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/[email protected] Discussion: https://postgr.es/m/[email protected] Backpatch: 16-, where the new relation extension logic was added
-rw-r--r--contrib/pg_visibility/expected/pg_visibility.out3
-rw-r--r--contrib/pg_visibility/sql/pg_visibility.sql6
2 files changed, 1 insertions, 8 deletions
diff --git a/contrib/pg_visibility/expected/pg_visibility.out b/contrib/pg_visibility/expected/pg_visibility.out
index 9de54db2a29..09fa5933a35 100644
--- a/contrib/pg_visibility/expected/pg_visibility.out
+++ b/contrib/pg_visibility/expected/pg_visibility.out
@@ -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
diff --git a/contrib/pg_visibility/sql/pg_visibility.sql b/contrib/pg_visibility/sql/pg_visibility.sql
index ff3538f9964..5af06ec5b76 100644
--- a/contrib/pg_visibility/sql/pg_visibility.sql
+++ b/contrib/pg_visibility/sql/pg_visibility.sql
@@ -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');