Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dbe29b0

Browse files
committed
Fix test instability introduced in e349c95 due to async deduplication.
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
1 parent 00cb86e commit dbe29b0

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/test/isolation/expected/stats.out

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,7 +3047,7 @@ step s1_slru_save_stats:
30473047
step s1_listen: LISTEN stats_test_nothing;
30483048
step s1_begin: BEGIN;
30493049
step s1_big_notify: SELECT pg_notify('stats_test_use',
3050-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3050+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
30513051

30523052
pg_notify
30533053
---------
@@ -3100,7 +3100,7 @@ step s1_slru_save_stats:
31003100

31013101
step s1_listen: LISTEN stats_test_nothing;
31023102
step s2_big_notify: SELECT pg_notify('stats_test_use',
3103-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3103+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
31043104

31053105
pg_notify
31063106
---------
@@ -3141,7 +3141,7 @@ step s1_slru_save_stats:
31413141
step s1_listen: LISTEN stats_test_nothing;
31423142
step s2_begin: BEGIN;
31433143
step s2_big_notify: SELECT pg_notify('stats_test_use',
3144-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3144+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
31453145

31463146
pg_notify
31473147
---------
@@ -3196,7 +3196,7 @@ f
31963196
(1 row)
31973197

31983198
step s2_big_notify: SELECT pg_notify('stats_test_use',
3199-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3199+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
32003200

32013201
pg_notify
32023202
---------
@@ -3263,7 +3263,7 @@ f
32633263
(1 row)
32643264

32653265
step s2_big_notify: SELECT pg_notify('stats_test_use',
3266-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3266+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
32673267

32683268
pg_notify
32693269
---------
@@ -3330,7 +3330,7 @@ f
33303330
(1 row)
33313331

33323332
step s2_big_notify: SELECT pg_notify('stats_test_use',
3333-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3333+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
33343334

33353335
pg_notify
33363336
---------
@@ -3397,7 +3397,7 @@ f
33973397
(1 row)
33983398

33993399
step s2_big_notify: SELECT pg_notify('stats_test_use',
3400-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3400+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
34013401

34023402
pg_notify
34033403
---------
@@ -3470,7 +3470,7 @@ f
34703470
(1 row)
34713471

34723472
step s2_big_notify: SELECT pg_notify('stats_test_use',
3473-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3473+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
34743474

34753475
pg_notify
34763476
---------
@@ -3543,7 +3543,7 @@ f
35433543
(1 row)
35443544

35453545
step s2_big_notify: SELECT pg_notify('stats_test_use',
3546-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3546+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
35473547

35483548
pg_notify
35493549
---------
@@ -3618,7 +3618,7 @@ test_stat_func| | |
36183618
(1 row)
36193619

36203620
step s2_big_notify: SELECT pg_notify('stats_test_use',
3621-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3621+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
36223622

36233623
pg_notify
36243624
---------
@@ -3661,7 +3661,7 @@ step s1_slru_save_stats:
36613661
step s1_listen: LISTEN stats_test_nothing;
36623662
step s1_begin: BEGIN;
36633663
step s2_big_notify: SELECT pg_notify('stats_test_use',
3664-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3664+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
36653665

36663666
pg_notify
36673667
---------

src/test/isolation/expected/stats_1.out

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,7 +3071,7 @@ step s1_slru_save_stats:
30713071
step s1_listen: LISTEN stats_test_nothing;
30723072
step s1_begin: BEGIN;
30733073
step s1_big_notify: SELECT pg_notify('stats_test_use',
3074-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3074+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
30753075

30763076
pg_notify
30773077
---------
@@ -3124,7 +3124,7 @@ step s1_slru_save_stats:
31243124

31253125
step s1_listen: LISTEN stats_test_nothing;
31263126
step s2_big_notify: SELECT pg_notify('stats_test_use',
3127-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3127+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
31283128

31293129
pg_notify
31303130
---------
@@ -3165,7 +3165,7 @@ step s1_slru_save_stats:
31653165
step s1_listen: LISTEN stats_test_nothing;
31663166
step s2_begin: BEGIN;
31673167
step s2_big_notify: SELECT pg_notify('stats_test_use',
3168-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3168+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
31693169

31703170
pg_notify
31713171
---------
@@ -3220,7 +3220,7 @@ f
32203220
(1 row)
32213221

32223222
step s2_big_notify: SELECT pg_notify('stats_test_use',
3223-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3223+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
32243224

32253225
pg_notify
32263226
---------
@@ -3287,7 +3287,7 @@ f
32873287
(1 row)
32883288

32893289
step s2_big_notify: SELECT pg_notify('stats_test_use',
3290-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3290+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
32913291

32923292
pg_notify
32933293
---------
@@ -3354,7 +3354,7 @@ f
33543354
(1 row)
33553355

33563356
step s2_big_notify: SELECT pg_notify('stats_test_use',
3357-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3357+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
33583358

33593359
pg_notify
33603360
---------
@@ -3421,7 +3421,7 @@ f
34213421
(1 row)
34223422

34233423
step s2_big_notify: SELECT pg_notify('stats_test_use',
3424-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3424+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
34253425

34263426
pg_notify
34273427
---------
@@ -3494,7 +3494,7 @@ f
34943494
(1 row)
34953495

34963496
step s2_big_notify: SELECT pg_notify('stats_test_use',
3497-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3497+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
34983498

34993499
pg_notify
35003500
---------
@@ -3567,7 +3567,7 @@ f
35673567
(1 row)
35683568

35693569
step s2_big_notify: SELECT pg_notify('stats_test_use',
3570-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3570+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
35713571

35723572
pg_notify
35733573
---------
@@ -3642,7 +3642,7 @@ test_stat_func| | |
36423642
(1 row)
36433643

36443644
step s2_big_notify: SELECT pg_notify('stats_test_use',
3645-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3645+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
36463646

36473647
pg_notify
36483648
---------
@@ -3685,7 +3685,7 @@ step s1_slru_save_stats:
36853685
step s1_listen: LISTEN stats_test_nothing;
36863686
step s1_begin: BEGIN;
36873687
step s2_big_notify: SELECT pg_notify('stats_test_use',
3688-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
3688+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
36893689

36903690
pg_notify
36913691
---------

src/test/isolation/specs/stats.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ step s1_slru_save_stats {
105105
}
106106
step s1_listen { LISTEN stats_test_nothing; }
107107
step s1_big_notify { SELECT pg_notify('stats_test_use',
108-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
108+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
109109
}
110110

111111
step s1_slru_check_stats {
@@ -147,7 +147,7 @@ step s2_table_update_k1 { UPDATE test_stat_tab SET value = value + 1 WHERE key =
147147

148148
# SLRU stats steps
149149
step s2_big_notify { SELECT pg_notify('stats_test_use',
150-
repeat('0', current_setting('block_size')::int / 2)) FROM generate_series(1, 3);
150+
repeat(i::text, current_setting('block_size')::int / 2)) FROM generate_series(1, 3) g(i);
151151
}
152152

153153

0 commit comments

Comments
 (0)