File: ndb_addnode.test

package info (click to toggle)
percona-xtrabackup 2.2.3-2.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 293,260 kB
  • ctags: 146,881
  • sloc: cpp: 1,051,960; ansic: 570,217; java: 54,595; perl: 53,495; pascal: 44,194; sh: 27,826; yacc: 15,314; python: 12,142; xml: 7,848; sql: 4,125; makefile: 1,459; awk: 785; lex: 758
file content (73 lines) | stat: -rw-r--r-- 2,228 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
61
62
63
64
65
66
67
68
69
70
71
72
73
--source include/ndb_have_online_alter.inc
-- source include/have_ndb.inc
-- source include/not_embedded.inc
--result_format 2

--exec $NDB_MGM -e show

CREATE LOGFILE GROUP lg_1
    ADD UNDOFILE 'undo_1.dat'
    INITIAL_SIZE 4M
    UNDO_BUFFER_SIZE 2M
    ENGINE NDB;

CREATE TABLESPACE ts_1
    ADD DATAFILE 'data_1.dat'
    USE LOGFILE GROUP lg_1
    INITIAL_SIZE 4M
    ENGINE NDB;

create table t1(id int NOT NULL PRIMARY KEY, data char(8)) engine=ndb;
create table t2(id int NOT NULL PRIMARY KEY, data char(8))
TABLESPACE ts_1 STORAGE DISK engine=ndb;

load data local infile 'suite/ndb/data/table_data10000.dat' into table t1 fields terminated by ' ' lines terminated by '\n';
load data local infile 'suite/ndb/data/table_data10000.dat' into table t2 fields terminated by ' ' lines terminated by '\n';

## Create nodegroup for "new" nodes
--exec $NDB_MGM -e "create nodegroup 3,4"

# Cluster running after adding two ndbd nodes
--exec $NDB_MGM -e show

## Drop
--exec $NDB_MGM -e "drop nodegroup 1"
## and create
--exec $NDB_MGM -e "create nodegroup 3,4"

create table t3(id int NOT NULL PRIMARY KEY, data char(8)) engine=ndb;
create table t4(id int NOT NULL PRIMARY KEY, data char(8))
TABLESPACE ts_1 STORAGE DISK engine=ndb;

insert into t3(id, data) VALUES 
(1,'new'), (2,'new'),(3,'new'),(4,'new'),(5,'new'),
(6,'new'),(7,'new'),(8,'new'),(9,'new'),(10,'new');
insert into t4(id, data) VALUES
(1,'new'), (2,'new'),(3,'new'),(4,'new'),(5,'new'),
(6,'new'),(7,'new'),(8,'new'),(9,'new'),(10,'new');

alter online table t1 reorganize partition;
alter online table t2 reorganize partition;

## Drop nodegroup with "new" nodes is not allowed with data one those nodes
# NOTE: --error=0 is due to return codes doesnt work on windoze
--error 0,255
--exec $NDB_MGM -e "drop nodegroup 1"

## Nodegroup with "new" nodes still exist after dropping it as shown:
--exec $NDB_MGM -e show

drop table t1,t2,t3,t4;

## Drop nodegroup with "new" nodes
--exec $NDB_MGM -e "drop nodegroup 1"

## Nodegroup with "new" nodes still exists after dropping it as shown:
--exec $NDB_MGM -e show

# Cleanup
ALTER TABLESPACE ts_1 DROP DATAFILE 'data_1.dat' ENGINE NDB;
DROP TABLESPACE ts_1 ENGINE NDB;
DROP LOGFILE GROUP lg_1 ENGINE NDB;

exit;