Skip to content

Commit 161363d

Browse files
author
Jan Wedvik
committed
Merged from mysql-5.1-telco-7.0.
2 parents b4975b2 + 27c16e7 commit 161363d

File tree

84 files changed

+7911
-719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+7911
-719
lines changed

libmysqld/Makefile.am

+4-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
4949
ha_ndbcluster.cc ha_ndbcluster_cond.cc ha_ndbcluster_push.cc \
5050
ha_ndbcluster_connection.cc ha_ndbinfo.cc \
5151
ha_ndb_index_stat.cc \
52-
ha_ndbcluster_binlog.cc ha_partition.cc \
52+
ha_ndbcluster_binlog.cc ndb_conflict_trans.cc ha_partition.cc \
5353
handler.cc sql_handler.cc \
5454
hostname.cc init.cc password.c \
5555
item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
@@ -130,6 +130,9 @@ ha_ndb_index_stat.o: ha_ndb_index_stat.cc
130130
ha_ndbinfo.o: ha_ndbinfo.cc
131131
$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
132132

133+
ndb_conflict_trans.o: ndb_conflict_trans.cc
134+
$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
135+
133136
# Until we can remove dependency on ha_ndbcluster.h
134137
handler.o: handler.cc
135138
$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[SYSTEM]
2+
Name=cluster1
3+
4+
[ndbd default]
5+
NoOfReplicas=1
6+
7+
[ndbd]
8+
NodeId=1
9+
LockExecuteThreadToCPU=0-3
10+
ThreadConfig: ldm={count=4}
11+
12+
[ndbd]
13+
NodeId=2
14+
LockExecuteThreadToCPU=4-8
15+
ThreadConfig: ldm={count=4,cpubind=0-3}
16+
17+
[ndbd]
18+
NodeId=3
19+
MaxNoOfExecutionThreads=3
20+
ThreadConfig: ldm={count=4}
21+
22+
[ndbd]
23+
NodeId=4
24+
LockExecuteThreadToCPU=0-3
25+
MaxNoOfExecutionThreads=7
26+
27+
[ndbd]
28+
NodeId=5
29+
ThreadConfig: ldm,ldm
30+
31+
[ndb_mgmd]
32+
HostName= localhost
33+
DataDir= /data/msvensson/mysql/mysql-5.1-new-maint/mysql-test/var/ndbcluster-10095 #
34+
PortNumber= 10095
35+
36+
[mysqld]

mysql-test/suite/ndb/r/ndb_basic.result

+16
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
22
drop database if exists mysqltest;
33
SHOW GLOBAL STATUS LIKE 'ndb\_%';
44
Variable_name Value
5+
Ndb_api_adaptive_send_deferred_count #
6+
Ndb_api_adaptive_send_deferred_count_session #
7+
Ndb_api_adaptive_send_deferred_count_slave #
8+
Ndb_api_adaptive_send_forced_count #
9+
Ndb_api_adaptive_send_forced_count_session #
10+
Ndb_api_adaptive_send_forced_count_slave #
11+
Ndb_api_adaptive_send_unforced_count #
12+
Ndb_api_adaptive_send_unforced_count_session #
13+
Ndb_api_adaptive_send_unforced_count_slave #
514
Ndb_api_bytes_received_count #
615
Ndb_api_bytes_received_count_session #
716
Ndb_api_bytes_received_count_slave #
@@ -66,9 +75,15 @@ Ndb_cluster_node_id #
6675
Ndb_config_from_host #
6776
Ndb_config_from_port #
6877
Ndb_conflict_fn_epoch #
78+
Ndb_conflict_fn_epoch_trans #
6979
Ndb_conflict_fn_max #
7080
Ndb_conflict_fn_max_del_win #
7181
Ndb_conflict_fn_old #
82+
Ndb_conflict_trans_conflict_commit_count #
83+
Ndb_conflict_trans_detect_iter_count #
84+
Ndb_conflict_trans_reject_count #
85+
Ndb_conflict_trans_row_conflict_count #
86+
Ndb_conflict_trans_row_reject_count #
7287
Ndb_connect_count #
7388
Ndb_execute_count #
7489
Ndb_index_stat_cache_clean #
@@ -107,6 +122,7 @@ ndb_log_bin #
107122
ndb_log_binlog_index #
108123
ndb_log_empty_epochs #
109124
ndb_log_orig #
125+
ndb_log_transaction_id #
110126
ndb_log_update_as_write #
111127
ndb_log_updated_only #
112128
ndb_mgmd_host #

mysql-test/suite/ndb/r/ndb_config.result

+11
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@ tcp,3,4,55,3 tcp,3,5,55,3 tcp,3,6,55,3 tcp,4,5,55,4 tcp,4,6,55,4 tcp,5,6,55,5 tc
4141
10485760 10485760 10485760 10485760 10485760
4242
1
4343
1
44+
== 21 == ThreadConfig
45+
WARNING -- at line 12: WARNING: Too few CPU's specified with LockExecuteThreadToCPU. Only 4 specified but 7 was needed, this may cause contention.
46+
Assigning LQH threads round robin to CPU(s) and other threads will share CPU 0
47+
48+
WARNING -- at line 17: Assigning each thread its own CPU
49+
50+
WARNING -- at line 22: ThreadConfig overrides MaxNoOfExecutionThreads
51+
WARNING -- at line 27: WARNING: Too few CPU's specified with LockExecuteThreadToCPU. Only 4 specified but 7 was needed, this may cause contention.
52+
Assigning LQH threads round robin to CPU(s) and other threads will share CPU 0
53+
54+
6,, 7,, 1,0-3,ldm={count=4} 2,4-8,ldm={count=4,cpubind=0-3} 3,,ldm={count=4} 4,0-3,main={cpubind=0},ldm={cpubind=1},ldm={cpubind=2},ldm={cpubind=3},ldm={cpubind=1},recv={cpubind=0},rep={cpubind=0} 5,,ldm,ldm

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

+4
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ echo == 19 == bug12712109;
6969
--exec $NDB_CONFIG --system --query=ConfigGenerationNumber
7070
# From a data node
7171
--exec $NDB_CONFIG --system --config-from-node=2 --query=ConfigGenerationNumber
72+
73+
echo == 21 == ThreadConfig;
74+
--replace_regex /.*\[ndb_config\]//
75+
--exec $NDB_CONFIG --config-file=$MYSQL_TEST_DIR/suite/ndb/ndb_config_threadconfig.ini --query=NodeId,LockExecuteThreadToCPU,ThreadConfig 2>&1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
use test;
2+
create table t1 (a int primary key, b int) engine=ndb;
3+
create table t2 (a int primary key, b int) engine=ndb;
4+
Single row autocommit transactions
5+
Should have 1 transaction id
6+
insert into t1 values (1,1);
7+
Number of different transaction ids in Binlog
8+
select count(1) as number_of_transactions from diff_extra_data;
9+
number_of_transactions
10+
1
11+
reset master;
12+
Should have 1 transaction id
13+
insert into t1 values (2,2);
14+
Number of different transaction ids in Binlog
15+
select count(1) as number_of_transactions from diff_extra_data;
16+
number_of_transactions
17+
1
18+
reset master;
19+
Should have 1 transaction id
20+
update t1 set b=20 where a=2;
21+
Number of different transaction ids in Binlog
22+
select count(1) as number_of_transactions from diff_extra_data;
23+
number_of_transactions
24+
1
25+
reset master;
26+
Multi row autocommit transaction
27+
Should have 1 transaction id
28+
delete from t1;
29+
Number of different transaction ids in Binlog
30+
select count(1) as number_of_transactions from diff_extra_data;
31+
number_of_transactions
32+
1
33+
reset master;
34+
Multi row explicit transaction
35+
Should have 1 transaction id
36+
begin;
37+
insert into t1 values (3,3);
38+
insert into t1 values (4,4);
39+
insert into t1 values (5,5);
40+
commit;
41+
Number of different transaction ids in Binlog
42+
select count(1) as number_of_transactions from diff_extra_data;
43+
number_of_transactions
44+
1
45+
reset master;
46+
Should have 1 transaction id
47+
begin;
48+
insert into t1 values (6,6);
49+
update t1 set b=40 where a=4;
50+
delete from t1 where a=5;
51+
commit;
52+
Number of different transaction ids in Binlog
53+
select count(1) as number_of_transactions from diff_extra_data;
54+
number_of_transactions
55+
1
56+
reset master;
57+
Multi table explicit transaction
58+
Should have 1 transaction id
59+
begin;
60+
insert into t1 values (7,7);
61+
insert into t2 values (7,7);
62+
insert into t2 values (8,8);
63+
commit;
64+
Number of different transaction ids in Binlog
65+
select count(1) as number_of_transactions from diff_extra_data;
66+
number_of_transactions
67+
1
68+
reset master;
69+
Multiple autocommit transactions
70+
Should have 2 transaction ids
71+
insert into t1 values (8,8);
72+
insert into t1 values (9,9);
73+
Number of different transaction ids in Binlog
74+
select count(1) as number_of_transactions from diff_extra_data;
75+
number_of_transactions
76+
2
77+
reset master;
78+
Multiple autocommit transactions on single row
79+
Should have 3 transaction ids
80+
insert into t1 values (10,10);
81+
update t1 set b=100 where a=10;
82+
delete from t1 where a=10;
83+
Number of different transaction ids in Binlog
84+
select count(1) as number_of_transactions from diff_extra_data;
85+
number_of_transactions
86+
3
87+
reset master;
88+
Multiple explicit transactions
89+
Should have 2 transaction ids
90+
begin;
91+
insert into t1 values (11,11);
92+
delete from t1;
93+
commit;
94+
begin;
95+
insert into t2 values (11,11);
96+
delete from t2;
97+
commit;
98+
Number of different transaction ids in Binlog
99+
select count(1) as number_of_transactions from diff_extra_data;
100+
number_of_transactions
101+
2
102+
reset master;
103+
drop table t1;
104+
drop table t2;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# Get the mysqlbinlog tool --verbose mode to dump the Binlog contents with
3+
# extra row data included, e.g.
4+
#
5+
#### Extra row data format: 0, len: 8 :0x0007200006000000
6+
#
7+
# Then process this input to get the number of distinct values, and hence
8+
# distinct transaction ids in the binlog
9+
#
10+
11+
--disable_query_log
12+
let $MYSQLD_DATADIR= `select @@datadir;`;
13+
--exec $MYSQL_BINLOG --verbose $MYSQLD_DATADIR/mysqld-bin.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
14+
15+
create table raw_binlog_rows (txt varchar(1000));
16+
create table diff_extra_data (txt varchar(1000));
17+
18+
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql' into table raw_binlog_rows columns terminated by '\n';
19+
20+
insert into diff_extra_data select distinct(txt) from raw_binlog_rows where txt like '### Extra row data %';
21+
--enable_query_log
22+
23+
--echo Number of different transaction ids in Binlog
24+
select count(1) as number_of_transactions from diff_extra_data;
25+
26+
--disable_query_log
27+
drop table diff_extra_data;
28+
drop table raw_binlog_rows;
29+
--enable_query_log
30+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--ndb-log-transaction-id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
--source include/have_ndb.inc
2+
--source include/have_log_bin.inc
3+
--source include/have_debug.inc
4+
5+
use test;
6+
7+
create table t1 (a int primary key, b int) engine=ndb;
8+
create table t2 (a int primary key, b int) engine=ndb;
9+
10+
--echo Single row autocommit transactions
11+
--echo Should have 1 transaction id
12+
insert into t1 values (1,1);
13+
14+
let $wait_binlog_event= COMMIT;
15+
--source include/wait_for_binlog_event.inc
16+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
17+
reset master;
18+
19+
--echo Should have 1 transaction id
20+
insert into t1 values (2,2);
21+
22+
let $wait_binlog_event= COMMIT;
23+
--source include/wait_for_binlog_event.inc
24+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
25+
reset master;
26+
27+
--echo Should have 1 transaction id
28+
update t1 set b=20 where a=2;
29+
30+
let $wait_binlog_event= COMMIT;
31+
--source include/wait_for_binlog_event.inc
32+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
33+
reset master;
34+
35+
--echo Multi row autocommit transaction
36+
--echo Should have 1 transaction id
37+
delete from t1;
38+
39+
let $wait_binlog_event= COMMIT;
40+
--source include/wait_for_binlog_event.inc
41+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
42+
reset master;
43+
44+
--echo Multi row explicit transaction
45+
--echo Should have 1 transaction id
46+
begin;
47+
insert into t1 values (3,3);
48+
insert into t1 values (4,4);
49+
insert into t1 values (5,5);
50+
commit;
51+
52+
let $wait_binlog_event= COMMIT;
53+
--source include/wait_for_binlog_event.inc
54+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
55+
reset master;
56+
57+
--echo Should have 1 transaction id
58+
begin;
59+
insert into t1 values (6,6);
60+
update t1 set b=40 where a=4;
61+
delete from t1 where a=5;
62+
commit;
63+
64+
let $wait_binlog_event= COMMIT;
65+
--source include/wait_for_binlog_event.inc
66+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
67+
reset master;
68+
69+
--echo Multi table explicit transaction
70+
--echo Should have 1 transaction id
71+
begin;
72+
insert into t1 values (7,7);
73+
insert into t2 values (7,7);
74+
insert into t2 values (8,8);
75+
commit;
76+
77+
let $wait_binlog_event= COMMIT;
78+
--source include/wait_for_binlog_event.inc
79+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
80+
reset master;
81+
82+
--echo Multiple autocommit transactions
83+
--echo Should have 2 transaction ids
84+
insert into t1 values (8,8);
85+
insert into t1 values (9,9);
86+
87+
let $wait_binlog_event= COMMIT;
88+
--source include/wait_for_binlog_event.inc
89+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
90+
reset master;
91+
92+
--echo Multiple autocommit transactions on single row
93+
--echo Should have 3 transaction ids
94+
insert into t1 values (10,10);
95+
update t1 set b=100 where a=10;
96+
delete from t1 where a=10;
97+
98+
let $wait_binlog_event= COMMIT;
99+
--source include/wait_for_binlog_event.inc
100+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
101+
reset master;
102+
103+
--echo Multiple explicit transactions
104+
--echo Should have 2 transaction ids
105+
begin;
106+
insert into t1 values (11,11);
107+
delete from t1;
108+
commit;
109+
110+
begin;
111+
insert into t2 values (11,11);
112+
delete from t2;
113+
commit;
114+
115+
let $wait_binlog_event= COMMIT;
116+
--source include/wait_for_binlog_event.inc
117+
--source suite/ndb_binlog/t/ndb_binlog_get_row_extra_data.inc
118+
reset master;
119+
120+
121+
drop table t1;
122+
drop table t2;

0 commit comments

Comments
 (0)