Skip to content

Commit f324d59

Browse files
committed
logictest: fix fk_cascade_race_150282
In #150291 we added subtest `fk_cascade_race_150282` which exercises FK checks performed by concurrent Serializable and Read Committed transactions. Unfortunately thanks to this test we've discovered that the locking added in #150291 is insufficient for preventing all FK violations. We need to turn on the disabled parent-FK-check locking for the Serializable transaction. This commmit fixes subtest `fk_cascade_race_150282` by turning on these settings for the Serializable transaction: - `enable_implicit_fk_locking_for_serializable` - `enable_shared_locking_for_serializable` - `enable_durable_locking_for_serializable` Informs: #151663 Release note: None
1 parent 1aabeeb commit f324d59

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pkg/ccl/logictestccl/testdata/logic_test/fk_read_committed

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ WITH sleep AS (SELECT pg_sleep(1)) DELETE FROM parent_150282@parent_150282_i_idx
140140
user testuser
141141

142142
statement ok
143+
SET enable_implicit_fk_locking_for_serializable = on;
144+
SET enable_shared_locking_for_serializable = on;
145+
SET enable_durable_locking_for_serializable = on;
143146
INSERT INTO child_150282 VALUES (4, 1);
144147

145148
user root
@@ -176,6 +179,9 @@ WITH sleep AS (SELECT pg_sleep(1)) UPDATE parent_150282 SET p = 4 WHERE i = 2;
176179
user testuser
177180

178181
statement ok
182+
SET enable_implicit_fk_locking_for_serializable = on;
183+
SET enable_shared_locking_for_serializable = on;
184+
SET enable_durable_locking_for_serializable = on;
179185
INSERT INTO child_150282 VALUES (4, 1);
180186

181187
user root
@@ -219,6 +225,9 @@ WITH sleep AS (SELECT pg_sleep(1)) DELETE FROM parent_150282 WHERE p = 1;
219225
user testuser
220226

221227
statement ok
228+
SET enable_implicit_fk_locking_for_serializable = on;
229+
SET enable_shared_locking_for_serializable = on;
230+
SET enable_durable_locking_for_serializable = on;
222231
INSERT INTO child_150282 VALUES (4, 1);
223232

224233
user root
@@ -236,4 +245,13 @@ query II
236245
SELECT * FROM child_150282;
237246
----
238247

248+
user testuser
249+
250+
statement ok
251+
RESET enable_implicit_fk_locking_for_serializable;
252+
RESET enable_shared_locking_for_serializable;
253+
RESET enable_durable_locking_for_serializable
254+
255+
user root
256+
239257
subtest end

0 commit comments

Comments
 (0)