MySQL InnoDB Cluster and
Group Replication
Madhusudhan G Joshi
(madhusudhan.joshi@oracle.com)
Software Development Manager
Sujatha Sivakumar
(sujatha.sivakumar@oracle.com)
Principal Member Technical Staf
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20172
Safe Harbour Statement
The following is intended to outline our general product direction. It
is intended for information purposes only, and may not be
incorporated into any contract.
It is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making purchasing
decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole
discretion of Oracle.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20173
Program Agenda
Introduction to MySQL Innodb Cluster
How to get it working
Introduction to Group Replication
Look and Feel of GR!
Monitoring
1
2
3
4
5
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20174
Introduction to MySQL Innodb Cluster1
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20175
InnoDB Cluster
Integrated Solution
●
Group Replication for high availability.
●
Asynchronous Replication for Read Scale-
out.
●
One-stop shell to deploy and manage the
cluster.
●
Seamlessly and automatically route the
workload to the proper database server
in the cluster.
●
Hide failures from the application.
M
M M
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MQL Shell
HA
S1 S2 S3 S4 S…
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20176
How to get it working2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20177
MySQL InnoDB Cluster
•
Start MySQL Shell
•
Deploy Instance (s)
•
dba.deploySandboxInstance(....)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20178
MySQL InnoDB Cluster
•
Start MySQL Shell
•
Deploy Instance (s)
•
Initiate/Create ClusterInitiate/Create Cluster
shell.connect("root@localhost:1310");shell.connect("root@localhost:1310");
cluster = dba.createCluster('OSIcluster');cluster = dba.createCluster('OSIcluster');
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20179
MySQL InnoDB Cluster
few more moments ….
Is the Cluster on and available ?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201710
MySQL InnoDB Cluster
•
Start MySQL Shell
•
Deploy Instance (s)
•
Create Cluster
Add few more instancesAdd few more instances
myOSI.addInstance("root@localhost:XXXX")myOSI.addInstance("root@localhost:XXXX")
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201711
MySQL InnoDB Cluster
How is the InnoDB Cluster now ?
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201712
MySQL InnoDB Cluster
•
Start MySQL Shell
•
Deploy Instance (s)
•
Create Cluster
•
Add more instances
Setup and start RouterSetup and start Router
bin/mysqlrouter --bootstrap localhost:bin/mysqlrouter --bootstrap localhost:
1310 --name OSIRouter1310 --name OSIRouter
Notice the
R/W, R ports
for MySQL
InnoDB
Cluster
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201713
MySQL InnoDB Cluster
MySQL Router
( layered on top of the MySQL Instances )
‘R’ Instance
Port :1311
‘R/W’ Instance
Port :1310
‘R’ Instance
Port :1312
Router is set and HA’d
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201714
MySQL InnoDB Cluster…on test
•
Start MySQL Shell
•
Deploy Instance (s)
•
Create Cluster
•
Add more instances
•
Setup and Start Router
Client connects to R/W InstanceClient connects to R/W Instance
andand
Kill R/W InstanceKill R/W Instance
Where do new client requests go to ???
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201715
MySQL InnoDB Cluster…on test
•
Start MySQL Shell
•
Deploy Instance (s)
•
Create Cluster
•
Add more instances
•
Setup and Start Router
•
Client Connects to R/W Instance
•
Kill R/W Instance
Client Requests handled by new R/W InstanClient Requests handled by new R/W Instan
How does the InnoDB Cluster look like
….now ???
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201716
MySQL InnoDB Cluster
MySQL Router
( layered on top of the MySQL Instances )
‘R/W’ Instance
Port :1311
‘R’ Instance
Port :1312
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 201717
Introduction to Group Replication3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201718
MySQL Group Replication
Traditional database
●
Many clients
●
One server
server
clients
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201719
MySQL Group Replication
server
A
server
B
server
C
clients
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201720
MySQL Group Replication
server
A
server
B
W WW
server
C
R RR R RR
clients
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201721
MySQL Group Replication
server
A
server
B
W RW
server
C
R W RW
clients
WR
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Limitations apply!
https://dev.mysql.com/doc/refman/8.0/en/group-replication-limitations.html
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201722
MySQL Group Replication
server
A
server
B
W RW
server
C
R W RW
clients
server
D
WR
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201723
MySQL Group Replication
server
A
server
B
W RW
server
C
WR R W RW
clients
server
D
server
E
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201724
MySQL Group Replication
server
A
server
B
W RW
server
C
R WR W RW
clients
server
D
server
E
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201725
MySQL Group Replication
server
A
server
B
W RW
server
C
R WR W RW
clients
server
D
server
E
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201726
MySQL Group Replication
server
A
server
B
W RW
server
C
R WR W RW
clients
server
E
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201727
MySQL Group Replication
server
A
server
B
W RW
server
C
R WR W RW
clients
server
E
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201728
MySQL Group Replication
server
A
server
B
W RW
server
C
R WR W RW
clients
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201729
8.0 Operations: Set Next Primary
BA C
W WW
SET group_replication_member_weight = [0-100]
Dw=25 w=20
R RR R RR R RR
w=10w=35
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201730
W WW
8.0 Operations: Set Next Primary
BA Cw=35 Dw=10 w=25 w=20
R RR R RR R RR
SET group_replication_member_weight = [0-100]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201731
8.0 Operations: Set Next Primary
B C Dw=10 w=25 w=20
? ? ?
W WW R RR R RR R RR
SET group_replication_member_weight = [0-100]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201732
SET group_replication_member_weight = [0-100]
8.0 Operations: Set Next Primary
B C Dw=10 w=25 w=20
? ? ?
W WW R RR R RR R RR
25 is the biggest
→ C is new primary
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201733
8.0 Operations: Set Next Primary
B C Dw=10 w=25 w=20
W WW R RR R RR R RR
SET group_replication_member_weight = [0-100]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201734
8.0 Operations: No Writes After Leaving
Group
BA C D
W WW
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201735
8.0 Operations: No Writes After Leaving
Group
BA C D
Locally on A:
STOP GROUP REPLICATION
W WW
1. Disallow new writes
2. Wait for ongoing writes
3. Leave group
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201736
8.0 Operations: No Writes After Leaving
Group
BA C D
Locally on A:
STOP GROUP REPLICATION
W WW
1. Disallow new writes
2. Wait for ongoing writes
3. Leave group
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201737
W WW
8.0 Operations: No Writes After Leaving
Group
BA C D
Locally on A:
STOP GROUP REPLICATION
1. Disallow new writes
2. Wait for ongoing writes
3. Leave group
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201738
MySQL Group Replication
server
A
server
B
W RW
server
C
R WR W RW
clients
We are 3:
A, B, C!
We are 3:
A, B, C!
We are 3:
A, B, C!
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201739
MySQL Group Replication
server
A
server
B
W RW
server
C
R WR W RW
clients
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201740
MySQL Group Replication
server
A
server
B
W RW R WR W RW
clients
You and me:
A and B!
You and me:
A and B!
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201741
MySQL Group Replication
server
A
server
B
W RW R WR W RW
clients
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
B B
A A
All receive in
same order
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201742
MySQL Group Replication
server
A
server
B
W RW R WR W RW
clients
Group Replication
●
Many clients
●
Many servers
●
Read scalability
●
Write everywhere*
●
Elastic,
Highly available
●
Agreement on:
●
Members
●
Message delivery
●
State updates
Table
row 1
row 2
row 3
Queue
insert row 4
Table
row 1
row 2
Queue
insert row 3
insert row 4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201743
MySQL Group Replication
server
A
server
B
W RW WR
clients
Group Replication
●
Non conflicting
transactions are
certified positive.
●
For Conflicting
transactions first
committer wins
UPDATE t1
SET a=3
WHERE a=1
UPDATE t1
SET a=4
Where a=2
OK OK
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201744
MySQL Group Replication
server
A
server
B
W RW WR
clients
Group Replication
●
Non conflicting
transactions are
certified positive.
●
For Conflicting
transactions first
committer wins
UPDATE t1
SET a=3
WHERE a=1 UPDATE t1
SET a=4
Where a=1OK
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 201745
Look and Feel of GR!4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201746
MySQL Group Replication
Group Replication
●
MySQL plugin
●
Uses InnoDB
●
Uses row format
●
Monitor using
performance schema
●
Full GTID support
●
Auto-increment
handling
●
Version access control
GR in 8 is gr8
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201747
MySQL Group Replication
Group Replication
●
MySQL plugin
●
Uses InnoDB
●
Monitor using
performance schema
●
●
Auto-increment
handling
●
Version access control
server
A
server
B
W RW WR
clients
INSERT x;
Will have
GTID:UUID:1
INSERT y;
Will have
GTID:UUID:2
Full GTID support
All group members share the same UUID, the
group name.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201748
MySQL Group Replication
Group Replication
●
MySQL plugin
●
Uses InnoDB
●
Monitor using
performance schema
●
Full GTID support
●
●
Version access control
server
A
server
B
W RW WR
INSERT x;
X:1
INSERT y;
Y:2
INSERT z;
Y:9
Auto-increment
handling
●
By default, the ofset is provided by
server_id and increment is 7.
●
Users can change the increment size using
group_replication_auto_increment_increment
option.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201749
MySQL Group Replication
Group Replication
●
MySQL plugin
●
Uses InnoDB
●
Monitor using
performance schema
●
Full GTID support
●
Auto-increment
handling
Version access control
MySQL
5.7.13
MySQL
5.7.14
W RW
MySQL
5.7.15
R WR W RW
Member with different patch version is allowed to
join the gorup.
MySQL
5.7.16
OK
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201750
MySQL Group Replication
Group Replication
●
MySQL plugin
●
Uses InnoDB
●
Monitor using
performance schema
●
Full GTID support
●
Auto-increment
handling
Version access control
MySQL
8.0
MySQL
8.0
W RW
MySQL
8.0
R WR W RW
Member with lower major version than the major
version in the group is not allowed to join group.
MySQL
5.7.16
No
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201751
MySQL Group Replication
Group Replication
●
MySQL plugin
●
Uses InnoDB
●
Monitor using
performance schema
●
Full GTID support
●
Auto-increment
handling
Version access control
MySQL
5.7.13
MySQL
5.7.14
W RW
MySQL
5.7.15
R WR W RW
Member with higher major version is allowed to
join but is not allowed to do writes. (Read only)
MySQL
8.0
OK
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201752
MySQL Async Replication
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201753
MySQL Async Replication
Example: Async replication between geo-distributed groups
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201754
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201755
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201756
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201757
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201758
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201759
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201760
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201761
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201762
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201763
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201764
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201765
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201766
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201767
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201768
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201769
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201770
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201771
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201772
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201773
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201774
Replication Architecture: Applier Pipeline
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201775
8.0 Performance: Applier Pipeline
 Parallelize reads and writes to relay log
 Performance for free
Replica
Relay
Log
Worker
Queues
Worker
Threads
Coordinator
Thread
Receiver
Thread
network
trx1
trx1
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 201776
Monitoring5
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201777
8.0 Monitoring: Group Members
 Who are in this group?
– server_uuid, host, port, MySQL version
 Who is the primary?
 Online status of each node
mysql> SELECT … FROM performance_schema.replication_group_members
MEMBER_ID MEMBER_HOST MEMBER_PORT MEMBER_STATE MEMBER_ROLE MEMBER_VERSION
<uuid-A> murkla 3306 ONLINE PRIMARY 5.7.20
<uuid-B> kremla 3306 ONLINE SECONDARY 5.7.21
<uuid-C> kantarell 3306 UNREACHABLE SECONDARY 8.0.3
New in 8.0
B
5.7.21
A
5.7.20
C
8.0.3
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201778
8.0 Monitoring: Group Member Statistics
 Statistics used to diagnose group members
– Conflict ratio of the group
– Conflict ratio of each member (multi-primary)
– Is any member falling behind on certification or applying?
 Table performance_schema.replication_group_member_stats:
counts of transactions, by member:
– Positively/negatively certified transactions of any origin
– Positively/negatively certified transactions from the node
– Transactions waiting to be certified
– Certified transactions waiting to be applied
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201779
“I can’t w8 to replic8 with version 8”
 Evalu8
http://www.mysql.com/downloads/
 Educ8
Innodb cluster:
https://dev.mysql.com/doc/refman/8.0/en/mysql-innodb-cluster-userguide.html
group replication:
http://dev.mysql.com/doc/refman/8.0/en/group-replication.html
 Contempl8
http://mysqlhighavailability.com
 Cooper8
https://bugs.mysql.com/
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201780
Thank You!& cu l8r, m8s
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. |81

MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

  • 1.
    MySQL InnoDB Clusterand Group Replication Madhusudhan G Joshi (madhusudhan.joshi@oracle.com) Software Development Manager Sujatha Sivakumar (sujatha.sivakumar@oracle.com) Principal Member Technical Staf
  • 2.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20172 Safe Harbour Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 3.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20173 Program Agenda Introduction to MySQL Innodb Cluster How to get it working Introduction to Group Replication Look and Feel of GR! Monitoring 1 2 3 4 5
  • 4.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20174 Introduction to MySQL Innodb Cluster1
  • 5.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20175 InnoDB Cluster Integrated Solution ● Group Replication for high availability. ● Asynchronous Replication for Read Scale- out. ● One-stop shell to deploy and manage the cluster. ● Seamlessly and automatically route the workload to the proper database server in the cluster. ● Hide failures from the application. M M M MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MQL Shell HA S1 S2 S3 S4 S…
  • 6.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20176 How to get it working2
  • 7.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20177 MySQL InnoDB Cluster • Start MySQL Shell • Deploy Instance (s) • dba.deploySandboxInstance(....)
  • 8.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20178 MySQL InnoDB Cluster • Start MySQL Shell • Deploy Instance (s) • Initiate/Create ClusterInitiate/Create Cluster shell.connect("root@localhost:1310");shell.connect("root@localhost:1310"); cluster = dba.createCluster('OSIcluster');cluster = dba.createCluster('OSIcluster');
  • 9.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 20179 MySQL InnoDB Cluster few more moments …. Is the Cluster on and available ?
  • 10.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201710 MySQL InnoDB Cluster • Start MySQL Shell • Deploy Instance (s) • Create Cluster Add few more instancesAdd few more instances myOSI.addInstance("root@localhost:XXXX")myOSI.addInstance("root@localhost:XXXX")
  • 11.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201711 MySQL InnoDB Cluster How is the InnoDB Cluster now ?
  • 12.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201712 MySQL InnoDB Cluster • Start MySQL Shell • Deploy Instance (s) • Create Cluster • Add more instances Setup and start RouterSetup and start Router bin/mysqlrouter --bootstrap localhost:bin/mysqlrouter --bootstrap localhost: 1310 --name OSIRouter1310 --name OSIRouter Notice the R/W, R ports for MySQL InnoDB Cluster
  • 13.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201713 MySQL InnoDB Cluster MySQL Router ( layered on top of the MySQL Instances ) ‘R’ Instance Port :1311 ‘R/W’ Instance Port :1310 ‘R’ Instance Port :1312 Router is set and HA’d
  • 14.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201714 MySQL InnoDB Cluster…on test • Start MySQL Shell • Deploy Instance (s) • Create Cluster • Add more instances • Setup and Start Router Client connects to R/W InstanceClient connects to R/W Instance andand Kill R/W InstanceKill R/W Instance Where do new client requests go to ???
  • 15.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201715 MySQL InnoDB Cluster…on test • Start MySQL Shell • Deploy Instance (s) • Create Cluster • Add more instances • Setup and Start Router • Client Connects to R/W Instance • Kill R/W Instance Client Requests handled by new R/W InstanClient Requests handled by new R/W Instan How does the InnoDB Cluster look like ….now ???
  • 16.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201716 MySQL InnoDB Cluster MySQL Router ( layered on top of the MySQL Instances ) ‘R/W’ Instance Port :1311 ‘R’ Instance Port :1312
  • 17.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 201717 Introduction to Group Replication3
  • 18.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201718 MySQL Group Replication Traditional database ● Many clients ● One server server clients
  • 19.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201719 MySQL Group Replication server A server B server C clients Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 20.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201720 MySQL Group Replication server A server B W WW server C R RR R RR clients Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 21.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201721 MySQL Group Replication server A server B W RW server C R W RW clients WR Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates Limitations apply! https://dev.mysql.com/doc/refman/8.0/en/group-replication-limitations.html
  • 22.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201722 MySQL Group Replication server A server B W RW server C R W RW clients server D WR Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 23.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201723 MySQL Group Replication server A server B W RW server C WR R W RW clients server D server E Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 24.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201724 MySQL Group Replication server A server B W RW server C R WR W RW clients server D server E Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 25.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201725 MySQL Group Replication server A server B W RW server C R WR W RW clients server D server E Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 26.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201726 MySQL Group Replication server A server B W RW server C R WR W RW clients server E Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 27.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201727 MySQL Group Replication server A server B W RW server C R WR W RW clients server E Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 28.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201728 MySQL Group Replication server A server B W RW server C R WR W RW clients Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 29.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201729 8.0 Operations: Set Next Primary BA C W WW SET group_replication_member_weight = [0-100] Dw=25 w=20 R RR R RR R RR w=10w=35
  • 30.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201730 W WW 8.0 Operations: Set Next Primary BA Cw=35 Dw=10 w=25 w=20 R RR R RR R RR SET group_replication_member_weight = [0-100]
  • 31.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201731 8.0 Operations: Set Next Primary B C Dw=10 w=25 w=20 ? ? ? W WW R RR R RR R RR SET group_replication_member_weight = [0-100]
  • 32.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201732 SET group_replication_member_weight = [0-100] 8.0 Operations: Set Next Primary B C Dw=10 w=25 w=20 ? ? ? W WW R RR R RR R RR 25 is the biggest → C is new primary
  • 33.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201733 8.0 Operations: Set Next Primary B C Dw=10 w=25 w=20 W WW R RR R RR R RR SET group_replication_member_weight = [0-100]
  • 34.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201734 8.0 Operations: No Writes After Leaving Group BA C D W WW
  • 35.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201735 8.0 Operations: No Writes After Leaving Group BA C D Locally on A: STOP GROUP REPLICATION W WW 1. Disallow new writes 2. Wait for ongoing writes 3. Leave group
  • 36.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201736 8.0 Operations: No Writes After Leaving Group BA C D Locally on A: STOP GROUP REPLICATION W WW 1. Disallow new writes 2. Wait for ongoing writes 3. Leave group
  • 37.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201737 W WW 8.0 Operations: No Writes After Leaving Group BA C D Locally on A: STOP GROUP REPLICATION 1. Disallow new writes 2. Wait for ongoing writes 3. Leave group
  • 38.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201738 MySQL Group Replication server A server B W RW server C R WR W RW clients We are 3: A, B, C! We are 3: A, B, C! We are 3: A, B, C! Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 39.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201739 MySQL Group Replication server A server B W RW server C R WR W RW clients Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 40.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201740 MySQL Group Replication server A server B W RW R WR W RW clients You and me: A and B! You and me: A and B! Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates
  • 41.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201741 MySQL Group Replication server A server B W RW R WR W RW clients Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates B B A A All receive in same order
  • 42.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201742 MySQL Group Replication server A server B W RW R WR W RW clients Group Replication ● Many clients ● Many servers ● Read scalability ● Write everywhere* ● Elastic, Highly available ● Agreement on: ● Members ● Message delivery ● State updates Table row 1 row 2 row 3 Queue insert row 4 Table row 1 row 2 Queue insert row 3 insert row 4
  • 43.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201743 MySQL Group Replication server A server B W RW WR clients Group Replication ● Non conflicting transactions are certified positive. ● For Conflicting transactions first committer wins UPDATE t1 SET a=3 WHERE a=1 UPDATE t1 SET a=4 Where a=2 OK OK
  • 44.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201744 MySQL Group Replication server A server B W RW WR clients Group Replication ● Non conflicting transactions are certified positive. ● For Conflicting transactions first committer wins UPDATE t1 SET a=3 WHERE a=1 UPDATE t1 SET a=4 Where a=1OK
  • 45.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 201745 Look and Feel of GR!4
  • 46.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201746 MySQL Group Replication Group Replication ● MySQL plugin ● Uses InnoDB ● Uses row format ● Monitor using performance schema ● Full GTID support ● Auto-increment handling ● Version access control GR in 8 is gr8
  • 47.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201747 MySQL Group Replication Group Replication ● MySQL plugin ● Uses InnoDB ● Monitor using performance schema ● ● Auto-increment handling ● Version access control server A server B W RW WR clients INSERT x; Will have GTID:UUID:1 INSERT y; Will have GTID:UUID:2 Full GTID support All group members share the same UUID, the group name.
  • 48.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201748 MySQL Group Replication Group Replication ● MySQL plugin ● Uses InnoDB ● Monitor using performance schema ● Full GTID support ● ● Version access control server A server B W RW WR INSERT x; X:1 INSERT y; Y:2 INSERT z; Y:9 Auto-increment handling ● By default, the ofset is provided by server_id and increment is 7. ● Users can change the increment size using group_replication_auto_increment_increment option.
  • 49.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201749 MySQL Group Replication Group Replication ● MySQL plugin ● Uses InnoDB ● Monitor using performance schema ● Full GTID support ● Auto-increment handling Version access control MySQL 5.7.13 MySQL 5.7.14 W RW MySQL 5.7.15 R WR W RW Member with different patch version is allowed to join the gorup. MySQL 5.7.16 OK
  • 50.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201750 MySQL Group Replication Group Replication ● MySQL plugin ● Uses InnoDB ● Monitor using performance schema ● Full GTID support ● Auto-increment handling Version access control MySQL 8.0 MySQL 8.0 W RW MySQL 8.0 R WR W RW Member with lower major version than the major version in the group is not allowed to join group. MySQL 5.7.16 No
  • 51.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201751 MySQL Group Replication Group Replication ● MySQL plugin ● Uses InnoDB ● Monitor using performance schema ● Full GTID support ● Auto-increment handling Version access control MySQL 5.7.13 MySQL 5.7.14 W RW MySQL 5.7.15 R WR W RW Member with higher major version is allowed to join but is not allowed to do writes. (Read only) MySQL 8.0 OK
  • 52.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201752 MySQL Async Replication
  • 53.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201753 MySQL Async Replication Example: Async replication between geo-distributed groups
  • 54.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201754 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 55.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201755 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 56.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201756 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 57.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201757 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 58.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201758 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 59.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201759 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 60.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201760 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 61.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201761 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 62.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201762 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 63.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201763 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 64.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201764 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 65.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201765 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 66.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201766 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 67.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201767 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 68.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201768 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 69.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201769 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 70.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201770 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 71.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201771 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 72.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201772 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 73.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201773 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 74.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201774 Replication Architecture: Applier Pipeline Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network
  • 75.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201775 8.0 Performance: Applier Pipeline  Parallelize reads and writes to relay log  Performance for free Replica Relay Log Worker Queues Worker Threads Coordinator Thread Receiver Thread network trx1 trx1
  • 76.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 201776 Monitoring5
  • 77.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201777 8.0 Monitoring: Group Members  Who are in this group? – server_uuid, host, port, MySQL version  Who is the primary?  Online status of each node mysql> SELECT … FROM performance_schema.replication_group_members MEMBER_ID MEMBER_HOST MEMBER_PORT MEMBER_STATE MEMBER_ROLE MEMBER_VERSION <uuid-A> murkla 3306 ONLINE PRIMARY 5.7.20 <uuid-B> kremla 3306 ONLINE SECONDARY 5.7.21 <uuid-C> kantarell 3306 UNREACHABLE SECONDARY 8.0.3 New in 8.0 B 5.7.21 A 5.7.20 C 8.0.3
  • 78.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201778 8.0 Monitoring: Group Member Statistics  Statistics used to diagnose group members – Conflict ratio of the group – Conflict ratio of each member (multi-primary) – Is any member falling behind on certification or applying?  Table performance_schema.replication_group_member_stats: counts of transactions, by member: – Positively/negatively certified transactions of any origin – Positively/negatively certified transactions from the node – Transactions waiting to be certified – Certified transactions waiting to be applied
  • 79.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201779 “I can’t w8 to replic8 with version 8”  Evalu8 http://www.mysql.com/downloads/  Educ8 Innodb cluster: https://dev.mysql.com/doc/refman/8.0/en/mysql-innodb-cluster-userguide.html group replication: http://dev.mysql.com/doc/refman/8.0/en/group-replication.html  Contempl8 http://mysqlhighavailability.com  Cooper8 https://bugs.mysql.com/
  • 80.
    Copyright © 2017,Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 201780 Thank You!& cu l8r, m8s
  • 81.
    Copyright © 2012,Oracle and/or its affiliates. All rights reserved. |81