File: galera_multi_level_foreign_key.inc

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (60 lines) | stat: -rw-r--r-- 1,720 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Execute parent query on node_1 and wait for it to reach node_2
#
--connection node_2
SET GLOBAL DEBUG_DBUG = '+d,sync.wsrep_apply_toi';

--connection node_1
--eval $fk_parent_query

--connection node_2
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_toi_reached";

SET SESSION wsrep_sync_wait = 0;
--let $expected_apply_waits = query_get_value("SHOW STATUS LIKE 'wsrep_apply_waits'", Value, 1)
--let $expected_apply_waits = `select $expected_apply_waits + 1`


#
# Execute child query on node_1.
# If bug is present, expect the wait condition
# to timeout and when the child query applies, it
# will be granted a MDL lock on parent table.
# When resumed, the parent query will
# also try to acquire MDL lock on parent table,
# causing a BF-BF conflict on that MDL lock.
#
--connection node_1
SET GLOBAL DEBUG_DBUG = '+d,wsrep_print_foreign_keys_table';
START TRANSACTION;
--eval $fk_child_query
--let $wait_condition = SELECT COUNT(*) = $fk_mdl_lock_num FROM performance_schema.metadata_locks WHERE OBJECT_SCHEMA='test' AND LOCK_STATUS="GRANTED"
--source include/wait_condition.inc
COMMIT;


#
# Expect the child query to depend on the parent query,
# therefore it should wait for the parent query to
# finish before it can be applied.
#
--connection node_2
--let $status_var = wsrep_apply_waits
--let $status_var_value = $expected_apply_waits
--source include/wait_for_status_var.inc

SET GLOBAL DEBUG_DBUG = '-d,sync.wsrep_apply_toi';
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_toi";


#
# Cleanup
#
SET DEBUG_SYNC = 'RESET';
SET GLOBAL DEBUG_DBUG = "";
SET GLOBAL wsrep_slave_threads=DEFAULT;

--connection node_1
SET DEBUG_SYNC = 'RESET';
SET GLOBAL DEBUG_DBUG = "";
SET GLOBAL wsrep_slave_threads=DEFAULT;