Debian Codegraph @

mysql-test/suite/ndb_rpl/r/ndb_rpl_batch.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 use test;
7 Create a couple of tables to defeat Binlog Injector's
8 creation of multi-image events which can be batch-applied
9 on the slave regardless of replica_allow_batching
10 create table t1 (pk int primary key, a varchar(8000))
11 engine=ndb character set latin1;
12 create table t2 (pk int primary key, a varchar(8000))
13 engine=ndb character set latin1;
14 Insert some data which we can later delete
15 This also serves to 'prime' the Slave, so that NdbApi
16 access related to slave setup (last_replicated_epoch fetch etc)
17 can be ignored.
18 insert into t1 values (1, repeat("I", 80)), (2, repeat("R", 80));
19 First pass with replica_allow_batching OFF
20 set global replica_allow_batching=OFF;
21 show variables like 'replica_allow_batching';
22 Variable_name Value
23 replica_allow_batching OFF
24 Check out batching
25 Transaction includes deletes + inserts, and
26 two different tables, shouldn't be entirely batchable
27 without replica_allow_batching
28 begin;
29 delete from t1;
30 insert into t1 values (3, repeat("I", 80)), (4, repeat("F", 80));
31 insert into t2 values (5, repeat("B", 90)), (6, repeat("E", 90));
32 commit;
33 delete from t1;
34 delete from t2;
35 insert into t1 values (1, repeat("I", 80)), (2, repeat("R", 80));
36 Second pass with replica_allow_batching ON
37 set global replica_allow_batching=ON;
38 show variables like 'replica_allow_batching';
39 Variable_name Value
40 replica_allow_batching ON
41 Check out batching
42 Transaction includes deletes + inserts, and
43 two different tables, shouldn't be batchable
44 without replica_allow_batching
45 begin;
46 delete from t1;
47 insert into t1 values (3, repeat("I", 80)), (4, repeat("F", 80));
48 insert into t2 values (5, repeat("B", 90)), (6, repeat("E", 90));
49 commit;
50 Determine slave activity in terms of PK ops and execute() calls
51 Check that test compared like-for-like, and that replica_allow_batching
52 came out ahead by a factor of at least 2.
53 SELECT @batching_on_pk_ops = @batching_off_pk_ops AS 'Fair contest';
54 Fair contest
55 1
56 SELECT @batching_off_pk_ops >=4 as 'Batching can improve matters';
57 Batching can improve matters
58 1
59 SELECT @batching_on_execs * 2 < @batching_off_execs AS 'replica_allow_batching works';
60 replica_allow_batching works
61 1
62 Cleanup
63 drop table t2;
64 drop table t1;
65 include/rpl_end.inc