Top Banner
MySQL InnoDB Cluster and Group Replication Madhusudhan G Joshi ([email protected]) Software Development Manager Sujatha Sivakumar ([email protected]) Principal Member Technical Staf
81

MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Jan 21, 2018

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

MySQL InnoDB Cluster and Group Replication

Madhusudhan G Joshi([email protected])Software Development Manager

Sujatha Sivakumar([email protected])Principal Member Technical Staf

Page 2: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 2

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.

Page 3: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 3

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

Page 4: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 4

Introduction to MySQL Innodb Cluster1

Page 5: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 5

InnoDB ClusterIntegrated 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…

Page 6: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 6

How to get it working2

Page 7: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 7

MySQL InnoDB Cluster

• Start MySQL Shell• Deploy Instance (s)• dba.deploySandboxInstance(....)

Page 8: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 8

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');

Page 9: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 9

MySQL InnoDB Cluster

few more moments ….

Is the Cluster on and available ?

Page 10: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 10

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");

Page 11: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 11

MySQL InnoDB ClusterHow is the InnoDB Cluster now ?

Page 12: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 12

MySQL InnoDB Cluster• Start MySQL Shell• Deploy Instance (s)• Create Cluster• Add more instances

Setup and start RouterSetup and start Routerbin/mysqlrouter --bootstrap localhost:bin/mysqlrouter --bootstrap localhost:

1310 --name OSIRouter1310 --name OSIRouter

Notice the R/W, R ports for MySQL

InnoDB Cluster

Page 13: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 13

MySQL InnoDB Cluster

MySQL Router( layered on top of the MySQL Instances )

‘R’ InstancePort :1311

‘R/W’ InstancePort :1310

‘R’ InstancePort :1312

Router is set and HA’d

Page 14: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 14

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 Client connects to R/W Instance

and and

Kill R/W InstanceKill R/W Instance

Where do new client requests go to ???

Page 15: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 15

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 InstanceClient Requests handled by new R/W Instance

How does the InnoDB Cluster look like ….now ???

Page 16: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 16

MySQL InnoDB Cluster

MySQL Router( layered on top of the MySQL Instances )

‘R/W’ InstancePort :1311

‘R’ InstancePort :1312

Page 17: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 2017 17

Introduction to Group Replication3

Page 18: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 18

MySQL Group ReplicationTraditional database● Many clients● One server

server

clients

Page 19: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 19

MySQL Group Replication

serverA

serverB

serverC

clientsGroup Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 20: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 20

MySQL Group Replication

serverA

serverB

W WW

serverC

R RR R RR

clientsGroup Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 21: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 21

MySQL Group Replication

serverA

serverB

W RW

serverC

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

Page 22: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 22

MySQL Group Replication

serverA

serverB

W RW

serverC

R W RW

clients

serverD

WR

Group Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 23: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 23

MySQL Group Replication

serverA

serverB

W RW

serverC

WR R W RW

clients

serverD

serverE

Group Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 24: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 24

MySQL Group Replication

serverA

serverB

W RW

serverC

R WR W RW

clients

serverD

serverE

Group Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 25: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 25

MySQL Group Replication

serverA

serverB

W RW

serverC

R WR W RW

clients

serverD

serverE

Group Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 26: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 26

MySQL Group Replication

serverA

serverB

W RW

serverC

R WR W RW

clients

serverE

Group Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 27: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 27

MySQL Group Replication

serverA

serverB

W RW

serverC

R WR W RW

clients

serverE

Group Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 28: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 28

MySQL Group Replication

serverA

serverB

W RW

serverC

R WR W RW

clientsGroup Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 29: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 29

8.0 Operations: Set Next Primary

B

A

C

W WW

SET group_replication_member_weight = [0-100]

Dw=25 w=20

R RR R RR R RR

w=10w=35

Page 30: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 30

W WW

8.0 Operations: Set Next Primary

B

A

Cw=35

Dw=10 w=25 w=20

R RR R RR R RR

SET group_replication_member_weight = [0-100]

Page 31: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 31

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]

Page 32: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 32

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

Page 33: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 33

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]

Page 34: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 34

8.0 Operations: No Writes After Leaving Group

B

A

C

D

W WW

Page 35: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 35

8.0 Operations: No Writes After Leaving Group

B

A

C

D

Locally on A:

STOP GROUP REPLICATION

W WW

1. Disallow new writes2. Wait for ongoing writes3. Leave group

Page 36: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 36

8.0 Operations: No Writes After Leaving Group

B

A

C

D

Locally on A:

STOP GROUP REPLICATION

W WW

1. Disallow new writes2. Wait for ongoing writes3. Leave group

Page 37: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 37

W WW

8.0 Operations: No Writes After Leaving Group

B

A

C

D

Locally on A:STOP GROUP REPLICATION

1. Disallow new writes2. Wait for ongoing writes3. Leave group

Page 38: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 38

MySQL Group Replication

serverA

serverB

W RW

serverC

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

Page 39: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 39

MySQL Group Replication

serverA

serverB

W RW

serverC

R WR W RW

clientsGroup Replication● Many clients● Many servers● Read scalability● Write everywhere*● Elastic,

Highly available● Agreement on:

● Members● Message delivery● State updates

Page 40: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 40

MySQL Group Replication

serverA

serverB

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

Page 41: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 41

MySQL Group Replication

serverA

serverB

W RW R WR W RW

clientsGroup 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 insame order

Page 42: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 42

MySQL Group Replication

serverA

serverB

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

Tablerow 1row 2row 3

Queue

insert row 4

Tablerow 1row 2

Queue

insert row 3insert row 4

Page 43: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 43

MySQL Group Replication

serverA

serverB

W RW WR

clients

Group Replication● Non conflicting

transactions are

certified positive.● For Conflicting

transactions firstcommitter wins

UPDATE t1 SET a=3

WHERE a=1

UPDATE t1SET a=4

Where a=2

OK OK

Page 44: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 44

MySQL Group Replication

serverA

serverB

W RW WRclients

Group Replication● Non conflicting

transactions are

certified positive.● For Conflicting

transactions firstcommitter wins

UPDATE t1 SET a=3

WHERE a=1 UPDATE t1SET a=4

Where a=1OK

Page 45: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 2017 45

Look and Feel of GR!4

Page 46: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 46

MySQL Group ReplicationGroup 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

Page 47: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 47

MySQL Group ReplicationGroup Replication● MySQL plugin● Uses InnoDB● Monitor using

performance schema●

● Auto-increment

handling● Version access control

serverA

serverB

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.

Page 48: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 48

MySQL Group ReplicationGroup Replication● MySQL plugin● Uses InnoDB● Monitor using

performance schema● Full GTID support●

● Version access control

serverA

serverB

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 usinggroup_replication_auto_increment_increment

option.

Page 49: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 49

MySQL Group ReplicationGroup 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

Page 50: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 50

MySQL Group ReplicationGroup 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

Page 51: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 51

MySQL Group ReplicationGroup 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

Page 52: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 52

MySQL Async Replication

Page 53: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 53

MySQL Async Replication

Example: Async replication between geo-distributed groups

Page 54: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 54

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 55: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 55

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 56: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 56

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 57: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 57

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 58: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 58

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 59: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 59

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 60: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 60

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 61: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 61

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 62: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 62

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 63: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 63

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 64: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 64

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 65: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 65

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 66: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 66

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 67: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 67

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 68: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 68

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 69: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 69

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 70: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 70

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 71: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 71

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 72: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 72

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 73: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 73

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 74: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 74

Replication Architecture: Applier Pipeline

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

Page 75: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 75

8.0 Performance: Applier Pipeline Parallelize reads and writes to relay log

Performance for free

Replica

RelayLog

WorkerQueues

WorkerThreads

Coordinator Thread

ReceiverThread

network

trx1

trx1

Page 76: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Percona Live, Dublin, 27 September 2017 76

Monitoring5

Page 77: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 77

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_membersMEMBER_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

B5.7.21

A5.7.20

C8.0.3

Page 78: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 78

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

Page 79: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 79

“I can’t w8 to replic8 with version 8” Evalu8

http://www.mysql.com/downloads/

Educ8Innodb 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

Contempl8http://mysqlhighavailability.com

Cooper8https://bugs.mysql.com/

Page 80: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | OSI, Bangalore, 13 October 2017 80

Thank You!& cu l8r, m8s

Page 81: MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. | 81