Debian Codegraph @

mysql-test/suite/group_replication/r/gr_xa_failover.result

raw
1 include/group_replication.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 server1]
6 include/only_with_option.inc [GLOBAL.xa_detach_on_prepare = 1]
7
8 ############################################################
9 # 1. Bootstrap a group with server1 as the primary.
10 [connection server1]
11 include/start_and_bootstrap_group_replication.inc
12 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
13
14 ############################################################
15 # 2. Join server2 to the group.
16 [connection server2]
17 include/start_group_replication.inc
18
19 ############################################################
20 # 3. Do the XA PREPARE on the initial primary (server1)
21 [connection server1]
22 FLUSH LOGS;
23 XA START '1';
24 INSERT INTO t1 VALUES (1);
25 XA END '1';
26 XA PREPARE '1';
27 include/rpl_sync.inc
28
29 ############################################################
30 # 4. server1 will leave the group, server2 will be elected
31 # primary.
32 # The client session that did the XA PREPARE will remain
33 # active.
34 [connection server1]
35 include/stop_group_replication.inc
36
37 ############################################################
38 # 5. server2 is the new primary, the XA transaction will be
39 # resumed on it.
40 # This mimics a load balancer behavior.
41 [connection server2]
42 XA COMMIT '1';
43 include/assert.inc ['There is a value 1 in table t1']
44
45 ############################################################
46 # 6. server1 rejoins the group, now as a secondary, it will
47 # receive the XA COMMIT through distributed recovery.
48 [connection server1]
49 include/start_group_replication.inc
50 include/assert.inc ['There is a value 1 in table t1']
51
52 ############################################################
53 # 7. Clean up.
54 [connection server2]
55 DROP TABLE t1;
56 include/group_replication_end.inc