| 1 |
show variables like 'log_bin'; |
| 2 |
Variable_name Value |
| 3 |
log_bin ON |
| 4 |
show variables like 'ndb_log_bin'; |
| 5 |
Variable_name Value |
| 6 |
ndb_log_bin ON |
| 7 |
Test 1 : Show that reorg of table being Binlogged does not result |
| 8 |
in any Binlog content |
| 9 |
create table t1 (a int primary key, b varchar(100), c int, unique(c)) engine=ndb; |
| 10 |
Insert 8192 rows |
| 11 |
Show t1 distribution prior to reorg |
| 12 |
TABLE_INFO |
| 13 |
PartitionCount: 8 |
| 14 |
Add new nodes |
| 15 |
Nodegroup 1 created |
| 16 |
Show empty binlog prior to reorg |
| 17 |
reset master; |
| 18 |
select count(1), sum(inserts), sum(updates), sum(deletes) from mysql.ndb_binlog_index; |
| 19 |
count(1) sum(inserts) sum(updates) sum(deletes) |
| 20 |
0 NULL NULL NULL |
| 21 |
Reorg table to use new nodes |
| 22 |
alter table t1 reorganize partition; |
| 23 |
Show t1 distribution after reorg |
| 24 |
TABLE_INFO |
| 25 |
PartitionCount: 16 |
| 26 |
Show empty binlog after reorg |
| 27 |
select count(1), sum(inserts), sum(updates), sum(deletes) from mysql.ndb_binlog_index; |
| 28 |
count(1) sum(inserts) sum(updates) sum(deletes) |
| 29 |
0 NULL NULL NULL |
| 30 |
Cleanup |
| 31 |
drop table t1; |
| 32 |
Drop Node Group 1 done |
| 33 |
Test 2 : Show that reorg of table with concurrent writes |
| 34 |
Results in Binlog content |
| 35 |
Create table including Blobs for interest |
| 36 |
create table test.t1 (a int auto_increment primary key, |
| 37 |
b text, |
| 38 |
c text, |
| 39 |
d int, unique(d)) engine=ndb; |
| 40 |
Load 100 rows first |
| 41 |
Show t1 distribution prior to reorg |
| 42 |
TABLE_INFO |
| 43 |
PartitionCount: 8 |
| 44 |
Add new nodes |
| 45 |
Nodegroup 1 created |
| 46 |
reset master; |
| 47 |
Show empty binlog prior to test |
| 48 |
select count(1), sum(inserts), sum(updates), sum(deletes) from mysql.ndb_binlog_index; |
| 49 |
count(1) sum(inserts) sum(updates) sum(deletes) |
| 50 |
0 NULL NULL NULL |
| 51 |
Request reorg starting in 2 seconds |
| 52 |
select sleep(2); alter table test.t1 reorganize partition;; |
| 53 |
Start I/U/D load on table |
| 54 |
Wait for reorg to complete |
| 55 |
sleep(2) |
| 56 |
0 |
| 57 |
Show t1 distribution after reorg |
| 58 |
TABLE_INFO |
| 59 |
PartitionCount: 16 |
| 60 |
Show Binlog content after reorg |
| 61 |
Expect to see content |
| 62 |
select count(epoch) > 100, |
| 63 |
sum(inserts) > 1000, |
| 64 |
sum(updates) > 1000, |
| 65 |
sum(deletes) > 1000 |
| 66 |
from mysql.ndb_binlog_index; |
| 67 |
count(epoch) > 100 sum(inserts) > 1000 sum(updates) > 1000 sum(deletes) > 1000 |
| 68 |
1 1 1 1 |
| 69 |
cleanup |
| 70 |
drop table test.t1; |
| 71 |
Drop Node Group 1 done |