Fix test instability introduced in e349c95d3e9 due to async deduplication.
authorAndres Freund <andres@anarazel.de>
Thu, 7 Apr 2022 18:54:51 +0000 (11:54 -0700)
committerAndres Freund <andres@anarazel.de>
Thu, 7 Apr 2022 18:58:04 +0000 (11:58 -0700)
The statement emitting notifies tried to make sure page boundaries were
crossed, but failed to do so reliably due to deduplication.

Reported-By: chap@anastigmatix.net
Discussion: https://postgr.es/m/20220407185408.n7dvsgqsb3q6uze7@alap3.anarazel.de

src/test/isolation/expected/stats.out
src/test/isolation/expected/stats_1.out
src/test/isolation/specs/stats.spec

index 7628a5f5da0f9627d37c766f6afc414ace94acc5..12234fbcd9ff5c225a9df8831fb1490eb713a0af 100644 (file)
@@ -3047,7 +3047,7 @@ step s1_slru_save_stats:
 step s1_listen: LISTEN stats_test_nothing;
 step s1_begin: BEGIN;
 step s1_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3100,7 +3100,7 @@ step s1_slru_save_stats:
 
 step s1_listen: LISTEN stats_test_nothing;
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3141,7 +3141,7 @@ step s1_slru_save_stats:
 step s1_listen: LISTEN stats_test_nothing;
 step s2_begin: BEGIN;
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3196,7 +3196,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3263,7 +3263,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3330,7 +3330,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3397,7 +3397,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3470,7 +3470,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3543,7 +3543,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3618,7 +3618,7 @@ test_stat_func|                          |                |
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3661,7 +3661,7 @@ step s1_slru_save_stats:
 step s1_listen: LISTEN stats_test_nothing;
 step s1_begin: BEGIN;
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
index 1c6533cc878cf0f4cda99b4edff8dc6ccb0995f2..beb959453de0c7da93f3f53e72bebe560f9205dd 100644 (file)
@@ -3071,7 +3071,7 @@ step s1_slru_save_stats:
 step s1_listen: LISTEN stats_test_nothing;
 step s1_begin: BEGIN;
 step s1_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3124,7 +3124,7 @@ step s1_slru_save_stats:
 
 step s1_listen: LISTEN stats_test_nothing;
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3165,7 +3165,7 @@ step s1_slru_save_stats:
 step s1_listen: LISTEN stats_test_nothing;
 step s2_begin: BEGIN;
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3220,7 +3220,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3287,7 +3287,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3354,7 +3354,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3421,7 +3421,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3494,7 +3494,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3567,7 +3567,7 @@ f
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3642,7 +3642,7 @@ test_stat_func|                          |                |
 (1 row)
 
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
@@ -3685,7 +3685,7 @@ step s1_slru_save_stats:
 step s1_listen: LISTEN stats_test_nothing;
 step s1_begin: BEGIN;
 step s2_big_notify: SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
 
 pg_notify
 ---------
index a3a18ca03de776c032d8a90a4aefc43df2678176..f27d11eede75a2f65e7b681053505f2fd865ae29 100644 (file)
@@ -105,7 +105,7 @@ step s1_slru_save_stats {
 }
 step s1_listen { LISTEN stats_test_nothing; }
 step s1_big_notify { SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
                 }
 
 step s1_slru_check_stats {
@@ -147,7 +147,7 @@ step s2_table_update_k1 { UPDATE test_stat_tab SET value = value + 1 WHERE key =
 
 # SLRU stats steps
 step s2_big_notify { SELECT pg_notify('stats_test_use',
-                repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
+                repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
                 }