Debian Codegraph @

mysql-test/suite/ndb/t/ndb_full_data_memory_restart.test

raw
1 --source include/have_ndb.inc
2
3 call mtr.add_suppression("The table 't1' is full");
4
5 create table t1(x int primary key) engine=ndbcluster;
6
7 # Node 1 can use 95% of data memory (MinFreePct=5)
8 # Node 2 can use 90% of data memory (MinFreePct=10)
9
10 # Stop node 2 so it is possible to use 95% of data memory
11 --exec $NDB_MGM -e "2 restart -n"
12 --exec $NDB_WAITER --not-started --wait-nodes=2
13
14 # Avoid problem with too large transactions.
15 set ndb_use_transactions=0;
16
17 # Disables warnings to get same behaviour on Windows and other platforms.
18 # Else for unknown reason warning is implicitly shown on Windows but not on
19 # other platforms.
20 --disable_warnings
21
22 # Use up all available data memory (95%)
23 --disable_query_log
24 insert into t1 values (0), (1);
25 set @n=1;
26 while (!$mysql_errno)
27 {
28 set @n= 2 * @n;
29 --error 0,1114
30 insert into t1 select @n + x from t1;
31 }
32 show warnings;
33 --enable_query_log
34 --enable_warnings
35
36 # Start node 2, during restart it can use all data memory (100%).
37 --exec $NDB_MGM -e "2 start"
38 --exec $NDB_WAITER
39
40 # Now after restart node 2 have no usable memory free.
41 delete from t1;
42
43 drop table t1;