Skip to content

Commit 3ca9f68

Browse files
committed
Modify concurrent isolation test to use non-batched mode for manual refresh
1 parent f46f9e0 commit 3ca9f68

5 files changed

Lines changed: 36 additions & 37 deletions

File tree

tsl/test/isolation/expected/cagg_concurrent_register.out

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ step s3_lock_before_register:
1313
BEGIN; LOCK TABLE _timescaledb_catalog.continuous_aggs_jobs_refresh_ranges;
1414

1515
step s1_run_cagg1_refresh:
16-
CALL refresh_continuous_aggregate('cagg_1', '2020-01-01 00:00:00+00', '2020-01-03 00:00:00+00');
16+
CALL refresh_continuous_aggregate('cagg_1', '2020-01-01 00:00:00+00', '2020-01-03 00:00:00+00', options => jsonb_build_object('buckets_per_batch', 0));
1717
<waiting ...>
1818
step s2_run_cagg2_overlap_refresh:
19-
CALL refresh_continuous_aggregate('cagg_2', '2020-01-03 00:00:00+00', '2020-01-05 00:00:00+00');
19+
CALL refresh_continuous_aggregate('cagg_2', '2020-01-03 00:00:00+00', '2020-01-05 00:00:00+00', options => jsonb_build_object('buckets_per_batch', 0));
2020
<waiting ...>
2121
step s4_enable_before_process_cagg_invalidations:
2222
SELECT debug_waitpoint_enable('before_process_cagg_invalidations_for_refresh_lock');
@@ -39,8 +39,8 @@ step s5_show_running_jobs:
3939

4040
cagg_name| start_range| end_range|start_ts_utc |end_ts_utc
4141
---------+----------------+----------------+------------------------+------------------------
42-
cagg_1 |1577980800000000|1578009600000000|Thu Jan 02 16:00:00 2020|Fri Jan 03 00:00:00 2020
43-
cagg_2 |1578153600000000|1578182400000000|Sat Jan 04 16:00:00 2020|Sun Jan 05 00:00:00 2020
42+
cagg_1 |1577836800000000|1578009600000000|Wed Jan 01 00:00:00 2020|Fri Jan 03 00:00:00 2020
43+
cagg_2 |1578009600000000|1578182400000000|Fri Jan 03 00:00:00 2020|Sun Jan 05 00:00:00 2020
4444

4545
step s4_release_before_process_cagg_invalidations:
4646
SELECT debug_waitpoint_release('before_process_cagg_invalidations_for_refresh_lock');
@@ -66,10 +66,10 @@ step s3_lock_before_register:
6666
BEGIN; LOCK TABLE _timescaledb_catalog.continuous_aggs_jobs_refresh_ranges;
6767

6868
step s1_run_cagg2_overlap_refresh:
69-
CALL refresh_continuous_aggregate('cagg_2', '2020-01-01 00:00:00+00', '2020-01-07 00:00:00+00');
69+
CALL refresh_continuous_aggregate('cagg_2', '2020-01-01 00:00:00+00', '2020-01-07 00:00:00+00', options => jsonb_build_object('buckets_per_batch', 0));
7070
<waiting ...>
7171
step s2_run_cagg2_overlap_refresh:
72-
CALL refresh_continuous_aggregate('cagg_2', '2020-01-03 00:00:00+00', '2020-01-05 00:00:00+00');
72+
CALL refresh_continuous_aggregate('cagg_2', '2020-01-03 00:00:00+00', '2020-01-05 00:00:00+00', options => jsonb_build_object('buckets_per_batch', 0));
7373
<waiting ...>
7474
step s4_enable_before_process_cagg_invalidations:
7575
SELECT debug_waitpoint_enable('before_process_cagg_invalidations_for_refresh_lock');
@@ -92,15 +92,14 @@ step s5_show_running_jobs:
9292

9393
cagg_name| start_range| end_range|start_ts_utc |end_ts_utc
9494
---------+----------------+----------------+------------------------+------------------------
95-
cagg_2 |1578153600000000|1578182400000000|Sat Jan 04 16:00:00 2020|Sun Jan 05 00:00:00 2020
96-
cagg_2 |1578268800000000|1578355200000000|Mon Jan 06 00:00:00 2020|Tue Jan 07 00:00:00 2020
95+
cagg_2 |1577836800000000|1578355200000000|Wed Jan 01 00:00:00 2020|Tue Jan 07 00:00:00 2020
9796

9897
step s4_release_before_process_cagg_invalidations:
9998
SELECT debug_waitpoint_release('before_process_cagg_invalidations_for_refresh_lock');
10099
<waiting ...>
101100
step s1_run_cagg2_overlap_refresh: <... completed>
102-
ERROR: could not refresh continuous aggregate "cagg_2" due to a concurrent refresh
103101
step s2_run_cagg2_overlap_refresh: <... completed>
102+
ERROR: could not refresh continuous aggregate "cagg_2" due to a concurrent refresh
104103
step s4_release_before_process_cagg_invalidations: <... completed>
105104
debug_waitpoint_release
106105
-----------------------
@@ -123,7 +122,7 @@ step s1_run_cagg2_nonoverlap_refresh:
123122
CALL refresh_continuous_aggregate('cagg_2', '2020-01-01 00:00:00+00', '2020-01-02 00:00:00+00');
124123
<waiting ...>
125124
step s2_run_cagg2_overlap_refresh:
126-
CALL refresh_continuous_aggregate('cagg_2', '2020-01-03 00:00:00+00', '2020-01-05 00:00:00+00');
125+
CALL refresh_continuous_aggregate('cagg_2', '2020-01-03 00:00:00+00', '2020-01-05 00:00:00+00', options => jsonb_build_object('buckets_per_batch', 0));
127126
<waiting ...>
128127
step s4_enable_before_process_cagg_invalidations:
129128
SELECT debug_waitpoint_enable('before_process_cagg_invalidations_for_refresh_lock');
@@ -147,7 +146,7 @@ step s5_show_running_jobs:
147146
cagg_name| start_range| end_range|start_ts_utc |end_ts_utc
148147
---------+----------------+----------------+------------------------+------------------------
149148
cagg_2 |1577836800000000|1577923200000000|Wed Jan 01 00:00:00 2020|Thu Jan 02 00:00:00 2020
150-
cagg_2 |1578153600000000|1578182400000000|Sat Jan 04 16:00:00 2020|Sun Jan 05 00:00:00 2020
149+
cagg_2 |1578009600000000|1578182400000000|Fri Jan 03 00:00:00 2020|Sun Jan 05 00:00:00 2020
151150

152151
step s4_release_before_process_cagg_invalidations:
153152
SELECT debug_waitpoint_release('before_process_cagg_invalidations_for_refresh_lock');

tsl/test/isolation/expected/cagg_refresh_cleanup_register.out

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ debug_waitpoint_enable
77

88

99
step R2_refresh:
10-
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15');
10+
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15', options => jsonb_build_object('buckets_per_batch', 0));
1111
<waiting ...>
1212
step L1_lock:
1313
BEGIN;
@@ -20,10 +20,10 @@ debug_waitpoint_release
2020

2121

2222
step R3_refresh:
23-
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15');
23+
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
2424
<waiting ...>
2525
step R4_refresh:
26-
CALL refresh_continuous_aggregate('cond_daily', '2026-03-15', '2026-03-30');
26+
CALL refresh_continuous_aggregate('cond_daily', '2026-03-15', '2026-03-30', options => jsonb_build_object('buckets_per_batch', 0));
2727
<waiting ...>
2828
step check_locks:
2929
SELECT l.mode, l.granted
@@ -50,7 +50,7 @@ step check_jobs:
5050

5151
user_view_name|start_time |end_time
5252
--------------+----------------------------+----------------------------
53-
cond_daily |Sun Feb 08 16:00:00 2026 PST|Sat Feb 14 16:00:00 2026 PST
53+
cond_daily |Mon Jan 05 16:00:00 2026 PST|Sat Feb 14 16:00:00 2026 PST
5454

5555
step L1_unlock:
5656
COMMIT;
@@ -89,7 +89,7 @@ debug_waitpoint_enable
8989

9090

9191
step R2_refresh:
92-
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15');
92+
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15', options => jsonb_build_object('buckets_per_batch', 0));
9393
<waiting ...>
9494
step L1_lock:
9595
BEGIN;
@@ -102,10 +102,10 @@ debug_waitpoint_release
102102

103103

104104
step R3_refresh:
105-
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15');
105+
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
106106
<waiting ...>
107107
step R4_overlapping_refresh:
108-
CALL refresh_continuous_aggregate('cond_daily', '2026-03-01', '2026-03-15');
108+
CALL refresh_continuous_aggregate('cond_daily', '2026-03-01', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
109109
<waiting ...>
110110
step check_locks:
111111
SELECT l.mode, l.granted
@@ -132,7 +132,7 @@ step check_jobs:
132132

133133
user_view_name|start_time |end_time
134134
--------------+----------------------------+----------------------------
135-
cond_daily |Sun Feb 08 16:00:00 2026 PST|Sat Feb 14 16:00:00 2026 PST
135+
cond_daily |Mon Jan 05 16:00:00 2026 PST|Sat Feb 14 16:00:00 2026 PST
136136

137137
step L1_unlock:
138138
COMMIT;
@@ -172,7 +172,7 @@ debug_waitpoint_enable
172172

173173

174174
step R3_refresh:
175-
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15');
175+
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
176176
<waiting ...>
177177
step check_jobs:
178178
SELECT ca.user_view_name,
@@ -185,7 +185,7 @@ step check_jobs:
185185

186186
user_view_name|start_time |end_time
187187
--------------+----------------------------+----------------------------
188-
cond_daily |Sat Mar 07 16:00:00 2026 PST|Sat Mar 14 17:00:00 2026 PDT
188+
cond_daily |Sun Feb 15 16:00:00 2026 PST|Sat Mar 14 17:00:00 2026 PDT
189189

190190
step A1_revoke_perm:
191191
REVOKE SELECT on conditions FROM cagg_user;
@@ -217,7 +217,7 @@ debug_waitpoint_enable
217217

218218

219219
step R3_refresh:
220-
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15');
220+
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
221221
<waiting ...>
222222
step check_jobs:
223223
SELECT ca.user_view_name,
@@ -230,7 +230,7 @@ step check_jobs:
230230

231231
user_view_name|start_time |end_time
232232
--------------+----------------------------+----------------------------
233-
cond_daily |Sat Mar 07 16:00:00 2026 PST|Sat Mar 14 17:00:00 2026 PDT
233+
cond_daily |Sun Feb 15 16:00:00 2026 PST|Sat Mar 14 17:00:00 2026 PDT
234234

235235
step A1_revoke_mat_perm:
236236
DO $$
@@ -273,7 +273,7 @@ debug_waitpoint_enable
273273

274274

275275
step R2_refresh:
276-
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15');
276+
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15', options => jsonb_build_object('buckets_per_batch', 0));
277277
<waiting ...>
278278
step check_jobs_metadata_manual:
279279
SELECT ca.user_view_name,
@@ -352,7 +352,7 @@ debug_waitpoint_enable
352352

353353

354354
step R1_refresh:
355-
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-03-15');
355+
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
356356
<waiting ...>
357357
step check_jobs:
358358
SELECT ca.user_view_name,
@@ -365,7 +365,7 @@ step check_jobs:
365365

366366
user_view_name|start_time |end_time
367367
--------------+----------------------------+----------------------------
368-
cond_daily |Tue Mar 10 17:00:00 2026 PDT|Sat Mar 14 17:00:00 2026 PDT
368+
cond_daily |Mon Jan 05 16:00:00 2026 PST|Sat Mar 14 17:00:00 2026 PDT
369369

370370
step K1_terminate:
371371
DO $$
@@ -400,10 +400,10 @@ step L1_lock:
400400
IN ACCESS EXCLUSIVE MODE;
401401

402402
step R2_refresh:
403-
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15');
403+
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15', options => jsonb_build_object('buckets_per_batch', 0));
404404
<waiting ...>
405405
step R3_refresh:
406-
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15');
406+
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
407407
<waiting ...>
408408
step L1_unlock:
409409
COMMIT;

tsl/test/isolation/specs/cagg_concurrent_policy_register.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ setup
5757
# Materialize L1 so the hierarchical L2 CAgg has source data
5858
setup
5959
{
60-
CALL refresh_continuous_aggregate('mat_3pol_m1', NULL, NULL);
60+
CALL refresh_continuous_aggregate('mat_3pol_m1', NULL, NULL, options => jsonb_build_object('buckets_per_batch', 0));
6161
}
6262

6363
# Create the hierarchical L2 CAgg with two adjacent refresh policies of its own

tsl/test/isolation/specs/cagg_concurrent_register.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ teardown {
6464

6565
session "S1"
6666
step "s1_run_cagg1_refresh" {
67-
CALL refresh_continuous_aggregate('cagg_1', '2020-01-01 00:00:00+00', '2020-01-03 00:00:00+00');
67+
CALL refresh_continuous_aggregate('cagg_1', '2020-01-01 00:00:00+00', '2020-01-03 00:00:00+00', options => jsonb_build_object('buckets_per_batch', 0));
6868
}
6969
step "s1_run_cagg2_overlap_refresh" {
70-
CALL refresh_continuous_aggregate('cagg_2', '2020-01-01 00:00:00+00', '2020-01-07 00:00:00+00');
70+
CALL refresh_continuous_aggregate('cagg_2', '2020-01-01 00:00:00+00', '2020-01-07 00:00:00+00', options => jsonb_build_object('buckets_per_batch', 0));
7171
}
7272
step "s1_run_cagg2_nonoverlap_refresh" {
7373
CALL refresh_continuous_aggregate('cagg_2', '2020-01-01 00:00:00+00', '2020-01-02 00:00:00+00');
@@ -76,7 +76,7 @@ step "s1_run_cagg2_nonoverlap_refresh" {
7676
session "S2"
7777

7878
step "s2_run_cagg2_overlap_refresh" {
79-
CALL refresh_continuous_aggregate('cagg_2', '2020-01-03 00:00:00+00', '2020-01-05 00:00:00+00');
79+
CALL refresh_continuous_aggregate('cagg_2', '2020-01-03 00:00:00+00', '2020-01-05 00:00:00+00', options => jsonb_build_object('buckets_per_batch', 0));
8080
}
8181

8282
step "s2_insert_new_data_2020" {

tsl/test/isolation/specs/cagg_refresh_cleanup_register.spec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ setup {
5959
INSERT INTO cancelpid SELECT pg_backend_pid();
6060
}
6161
step "R1_refresh" {
62-
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-03-15');
62+
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
6363
}
6464

6565
# Session WP: enables / disables waitpoints
@@ -102,7 +102,7 @@ setup {
102102
SET SESSION lock_timeout = '2s';
103103
}
104104
step "R2_refresh" {
105-
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15');
105+
CALL refresh_continuous_aggregate('cond_daily', '2026-01-05', '2026-02-15', options => jsonb_build_object('buckets_per_batch', 0));
106106
}
107107

108108
session "R3"
@@ -111,7 +111,7 @@ setup {
111111
SET SESSION lock_timeout = '2s';
112112
}
113113
step "R3_refresh" {
114-
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15');
114+
CALL refresh_continuous_aggregate('cond_daily', '2026-02-15', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
115115
}
116116

117117
session "R4"
@@ -120,10 +120,10 @@ setup {
120120
SET SESSION lock_timeout = '2s';
121121
}
122122
step "R4_refresh" {
123-
CALL refresh_continuous_aggregate('cond_daily', '2026-03-15', '2026-03-30');
123+
CALL refresh_continuous_aggregate('cond_daily', '2026-03-15', '2026-03-30', options => jsonb_build_object('buckets_per_batch', 0));
124124
}
125125
step "R4_overlapping_refresh" {
126-
CALL refresh_continuous_aggregate('cond_daily', '2026-03-01', '2026-03-15');
126+
CALL refresh_continuous_aggregate('cond_daily', '2026-03-01', '2026-03-15', options => jsonb_build_object('buckets_per_batch', 0));
127127
}
128128

129129
session "A1"

0 commit comments

Comments
 (0)