| 1 |
-- source include/have_ndb.inc |
| 2 |
-- source have_ndb_error_insert.inc |
| 3 |
-- source include/not_asan.inc |
| 4 |
|
| 5 |
# Ignore the warning generated by ndbcluster's binlog thread |
| 6 |
# when cluster is restarted |
| 7 |
--disable_query_log ONCE |
| 8 |
call mtr.add_suppression("cluster disconnect An incident event has been written"); |
| 9 |
|
| 10 |
# Ignore the warning generated by ndbcluster's binlog thread |
| 11 |
# when cluster is restarted - also on the second mysqld |
| 12 |
connect(mysqld2,127.0.0.1,root,,test,$MASTER_MYPORT1); |
| 13 |
connection mysqld2; |
| 14 |
--disable_query_log ONCE |
| 15 |
call mtr.add_suppression("cluster disconnect An incident event has been written"); |
| 16 |
|
| 17 |
connection default; |
| 18 |
|
| 19 |
--let $KEYS=40 |
| 20 |
|
| 21 |
use test; |
| 22 |
|
| 23 |
--echo Test read-locality of READ-BACKUP |
| 24 |
|
| 25 |
create table test.t1 (a int primary key, |
| 26 |
b int, |
| 27 |
c int, |
| 28 |
d int, |
| 29 |
unique(b) using hash, |
| 30 |
key(c), |
| 31 |
key(a,c)) |
| 32 |
comment="NDB_TABLE=READ_BACKUP=1" |
| 33 |
engine=ndb; |
| 34 |
|
| 35 |
create table test.t2 (a int primary key, |
| 36 |
b int, |
| 37 |
c int, |
| 38 |
d text, |
| 39 |
unique(b) using hash, |
| 40 |
key(c)) |
| 41 |
comment="NDB_TABLE=READ_BACKUP=1" |
| 42 |
engine=ndb; |
| 43 |
|
| 44 |
--source ndb_read_local.inc |
| 45 |
|
| 46 |
drop table test.t1; |
| 47 |
drop table test.t2; |
| 48 |
|
| 49 |
--echo Test read-locality after ALTER TABLE into READ-BACKUP |
| 50 |
|
| 51 |
create table test.t1 (a int primary key, |
| 52 |
b int, |
| 53 |
c int, |
| 54 |
d int, |
| 55 |
unique(b) using hash, |
| 56 |
key(c), |
| 57 |
key(a,c)) |
| 58 |
engine=ndb; |
| 59 |
|
| 60 |
create table test.t2 (a int primary key, |
| 61 |
b int, |
| 62 |
c int, |
| 63 |
d text, |
| 64 |
unique(b) using hash, |
| 65 |
key(c)) |
| 66 |
engine=ndb; |
| 67 |
|
| 68 |
alter table t1 algorithm=inplace, comment="NDB_TABLE=READ_BACKUP=1"; |
| 69 |
alter table t2 algorithm=inplace, comment="NDB_TABLE=READ_BACKUP=1"; |
| 70 |
|
| 71 |
let $ndb_desc_opts= -b -i -d test t2; |
| 72 |
source suite/ndb/include/ndb_desc_print.inc; |
| 73 |
--source ndb_read_local.inc |
| 74 |
|
| 75 |
--exec $NDB_MGM -e "all restart" |
| 76 |
--source include/ndb_not_readonly.inc |
| 77 |
let $ndb_desc_opts= -b -i -d test t2; |
| 78 |
source suite/ndb/include/ndb_desc_print.inc; |
| 79 |
--source ndb_read_local.inc |
| 80 |
|
| 81 |
drop table test.t1; |
| 82 |
drop table test.t2; |
| 83 |
|
| 84 |
--echo Test read-locality of FULLY-REPLICATED |
| 85 |
|
| 86 |
create table test.t1 (a int primary key, |
| 87 |
b int, |
| 88 |
c int, |
| 89 |
d int, |
| 90 |
unique(b) using hash, |
| 91 |
key(c), |
| 92 |
key(a,c)) |
| 93 |
comment="NDB_TABLE=FULLY_REPLICATED=1" |
| 94 |
engine=ndb; |
| 95 |
|
| 96 |
create table test.t2 (a int primary key, |
| 97 |
b int, |
| 98 |
c int, |
| 99 |
d text, |
| 100 |
unique(b) using hash, |
| 101 |
key(c)) |
| 102 |
comment="NDB_TABLE=FULLY_REPLICATED=1" |
| 103 |
engine=ndb; |
| 104 |
|
| 105 |
--source ndb_read_local.inc |
| 106 |
|
| 107 |
--exec $NDB_MGM -e'create nodegroup 3,4' |
| 108 |
alter table t1 algorithm=inplace, reorganize partition; |
| 109 |
alter table t2 algorithm=inplace, reorganize partition; |
| 110 |
|
| 111 |
--source ndb_read_local.inc |
| 112 |
|
| 113 |
--exec $NDB_MGM -e'create nodegroup 5,6' |
| 114 |
alter table t1 algorithm=inplace, reorganize partition; |
| 115 |
alter table t2 algorithm=inplace, reorganize partition; |
| 116 |
|
| 117 |
--source ndb_read_local.inc |
| 118 |
|
| 119 |
drop table test.t1; |
| 120 |
drop table test.t2; |
| 121 |
|
| 122 |
--exec $NDB_MGM -e'drop nodegroup 2' |
| 123 |
--exec $NDB_MGM -e'drop nodegroup 1' |
| 124 |
|
| 125 |
--echo Test read-locality of FULLY-REPLICATED with FOR_RA_BY_NODE |
| 126 |
|
| 127 |
create table test.t1 (a int primary key, |
| 128 |
b int, |
| 129 |
c int, |
| 130 |
d int, |
| 131 |
unique(b) using hash, |
| 132 |
key(c), |
| 133 |
key(a,c)) |
| 134 |
comment="NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_NODE" |
| 135 |
engine=ndb; |
| 136 |
|
| 137 |
create table test.t2 (a int primary key, |
| 138 |
b int, |
| 139 |
c int, |
| 140 |
d text, |
| 141 |
unique(b) using hash, |
| 142 |
key(c)) |
| 143 |
comment="NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_NODE" |
| 144 |
engine=ndb; |
| 145 |
|
| 146 |
--source ndb_read_local.inc |
| 147 |
|
| 148 |
--exec $NDB_MGM -e'create nodegroup 3,4' |
| 149 |
alter table t1 algorithm=inplace, reorganize partition; |
| 150 |
alter table t2 algorithm=inplace, reorganize partition; |
| 151 |
|
| 152 |
--source ndb_read_local.inc |
| 153 |
|
| 154 |
--exec $NDB_MGM -e'create nodegroup 5,6' |
| 155 |
alter table t1 algorithm=inplace, reorganize partition; |
| 156 |
alter table t2 algorithm=inplace, reorganize partition; |
| 157 |
|
| 158 |
--source ndb_read_local.inc |
| 159 |
|
| 160 |
drop table test.t1; |
| 161 |
drop table test.t2; |
| 162 |
|
| 163 |
--exec $NDB_MGM -e'drop nodegroup 1' |
| 164 |
--exec $NDB_MGM -e'drop nodegroup 2' |