MySQL Developer Day conference: MySQL Replication and Scalability
-
Upload
shivji-kumar-jha -
Category
Technology
-
view
122 -
download
0
description
Transcript of MySQL Developer Day conference: MySQL Replication and Scalability
![Page 1: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/1.jpg)
MySQL Replication and Scalability
Shivji JhaSoftware Developer,MySQL Replication Team
![Page 2: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/2.jpg)
2 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
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 Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/3.jpg)
3 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
OverviewMySQL Replication: Discover What's New
Overview: MySQL Replication
Consistency: Lossless Semi-Sync
Slave Throughput: Improved Multi-Threaded Slave
Flexibility: Multi-Source Replication
Monitoring: Performance_Schema Tables
Next steps
![Page 4: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/4.jpg)
4 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
“In my opinion, MySQL is the only database we would ever trust to power the Zappos.com website.”
"On any given day we can sell close to 300,000 tickets on the Web site using MySQL as the database to search for events. It is amazing."
"craigslist infrastructure could not have handled the exponential growth in traffic without MySQL.”
“We are one of the largest MySQL web sites in production
MySQL Replication In Action on the Web
“As a leader in our field, we are committed to providing the best service to our users, and a web experience that meets members expectations and that starts with IT”
![Page 5: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/5.jpg)
5 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
What isReplication?
![Page 6: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/6.jpg)
6 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Replication: Copy Changes Master → Slave
MySQL Master Server● Changes data● Sends changes to slave
MySQL Slave Server● Receives changes from master● Applies received changes to database
M S
![Page 7: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/7.jpg)
7 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Replication: Copy Changes Master → Slave
M M/S S
S
S
S
M
Server can be master, slave or both
Master can have multiple slaves
![Page 8: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/8.jpg)
8 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Replication: Copy Changes Master → Slave
SM
M
Slave can only have one master
SM
MSlave can have multiple masters!labs.mysql.com
labsYippee!
![Page 9: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/9.jpg)
9 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Replication: Copy Changes Master → Slave
M/S
Circular replication is also possible
M/S
M/S
M/S
M/S
M/S
![Page 10: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/10.jpg)
10 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Replication: Copy Changes Master → Slave
Filters on slave
SM
Replicationfilter
I have a lotof tables
I only havetable_1
![Page 11: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/11.jpg)
11 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why UseReplication?
![Page 12: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/12.jpg)
12 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why Replication? – Performance
Read scale-out
M S
write clients read clients
![Page 13: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/13.jpg)
13 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why Replication? – Performance
Read scale-out
M S
write clients read clients
Morereads?More
slaves!
![Page 14: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/14.jpg)
14 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why Replication? – Performance
Read scale-out
M SS
S
S
M
write clients read clients read clients
write clients
Morereads?More
slaves!
![Page 15: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/15.jpg)
15 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why Replication? – Redundancy
If master crashes, promote slave to master
C
B
A
![Page 16: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/16.jpg)
16 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why Replication? – Redundancy
If master crashes, promote slave to master
C
B
ACrash
![Page 17: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/17.jpg)
17 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why Replication? – Redundancy
If master crashes, promote slave to master
C
B
A
B is thenew master
![Page 18: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/18.jpg)
18 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why Replication? – Online backup/reporting
Expensive queries on slave(s)
M S
Regular clients
Reports Big queries Business intelligence
![Page 19: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/19.jpg)
19 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why Replication? – Long-distance Data Distribution
CB
BAAC
Image fromwww.ginkgomaps.com
![Page 20: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/20.jpg)
20 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
How DoesReplication
Work?
![Page 21: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/21.jpg)
21 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
All Transactions Written to Binary Log
A
binary log
Client
![Page 22: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/22.jpg)
22 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
All Transactions Written to Binary Log
create table t (a int);
A
binary log
Client
![Page 23: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/23.jpg)
23 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
All Transactions Written to Binary Log
create table t (a int);
Table t
create...
A
binary log
Client
![Page 24: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/24.jpg)
24 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
All Transactions Written to Binary Log
create table t (a int);insert into t values (1);
Table t
create...
A
binary log
Client
![Page 25: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/25.jpg)
25 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
All Transactions Written to Binary Log
create table t (a int);insert into t values (1);
Table t1
create...insert...A
binary log
Client
![Page 26: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/26.jpg)
26 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Slave Initiates Replication
B
binary log
A
binary log
Client1. Slave sends request
for replication to startto master
2. Master sends streamof replication data
to slave
![Page 27: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/27.jpg)
27 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Binary Log Sent to Slave, Re-applied
B
binary log
A
binary log
Client
![Page 28: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/28.jpg)
28 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Binary Log Sent to Slave, Re-applied
B
binary log
A
binary log
Client
![Page 29: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/29.jpg)
29 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Binary Log Sent to Slave, Re-applied
Table t
B
binary log
create...
A
binary log
Client
![Page 30: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/30.jpg)
30 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Binary Log Sent to Slave, Re-applied
Table t Table t
create...
B
binary log
create...
A
binary log
Client
![Page 31: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/31.jpg)
31 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Binary Log Sent to Slave, Re-applied
Table t Table t
create...
B
binary log
create...
A
binary log
Client
![Page 32: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/32.jpg)
32 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Binary Log Sent to Slave, Re-applied
Table t1
Table t
create...
B
binary log
create...insert...A
binary log
Client
![Page 33: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/33.jpg)
33 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Binary Log Sent to Slave, Re-applied
Table t1
Table t1
create...insert...B
binary log
create...insert...A
binary log
Client
![Page 34: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/34.jpg)
34 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Actually, Transactions Land in Slave's Relay Log
B
binary logrelay log
A
binary log
Client
![Page 35: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/35.jpg)
35 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Actually, Transactions Land in Slave's Relay Log
B
binary logrelay log
A
binary log
Client
![Page 36: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/36.jpg)
36 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Actually, Transactions Land in Slave's Relay Log
B
binary logrelay log
create...
A
binary log
Client
Table t
![Page 37: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/37.jpg)
37 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Actually, Transactions Land in Slave's Relay Log
B
binary log
create...
relay log
create...
A
binary log
Client
Table t
![Page 38: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/38.jpg)
38 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Actually, Transactions Land in Slave's Relay Log
create...
B
binary log
create...
relay log
create...
A
binary log
Client
Table t Table t
![Page 39: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/39.jpg)
39 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Replication is Asynchronous
create...
B
binary log
create...
relay log
create...
A
binary log
Client
Table t Table tTransactionapplied here
andcopied here
THENapplied here
THENack'ed
![Page 40: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/40.jpg)
40 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Replication is Asynchronous
create...
B
binary log
create...
relay log
create...
A
binary log
Client
Table t Table tTransactionapplied here
andcopied here
THENapplied here
THENack'ed
![Page 41: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/41.jpg)
41 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Replication is Asynchronous
create...
B
binary log
create...
relay log
create...insert...A
binary log
Client
Table t1
Table tTransactionapplied here
andcopied here
THENapplied here
THENack'ed
![Page 42: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/42.jpg)
42 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Replication is Asynchronous
create...
B
binary log
create...
relay log
create...insert...A
binary log
Client
Table t1
Table tTransactionapplied here
andcopied here
THENapplied here
THENack'ed
![Page 43: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/43.jpg)
43 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Replication is Asynchronous
create...
B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table tTransactionapplied here
andcopied here
THENapplied here
THENack'ed
![Page 44: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/44.jpg)
44 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Replication is Asynchronous
create...insert...B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table t1Transaction
applied hereand
copied hereTHEN
applied hereTHENack'ed
![Page 45: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/45.jpg)
45 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
OverviewMySQL Replication: Discover What's New
Overview: MySQL Replication
Consistency: Lossless Semi-Sync
Slave Throughput: Improved Multi-Threaded Slave
Flexibility: Multi-Source Replication
Monitoring: Performance_Schema Tables
Next steps
![Page 46: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/46.jpg)
46 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
What isSemi-Synchronous
Replication?
![Page 47: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/47.jpg)
47 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Asynchronous vs Semi-sync Replication
By default, replication is asynchronous● In parallel: Master acks to app and sends transaction to slave
● Fast● Changes lost if master dies
MySQL 5.5: semi-synchronous replication possible● In sequence: slave receives transaction, then master acks to app
● Slower: Master waits for slave● Less risk for lost updates
![Page 48: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/48.jpg)
48 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Semi-Synchronous Replication (MySQL 5.5)
create...
B
binary log
create...
relay log
create...
A
binary log
Client
Table t Table tTransactionapplied here
THENcopied here
andapplied here
THENack'ed
![Page 49: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/49.jpg)
49 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Semi-Synchronous Replication (MySQL 5.5)
create...
B
binary log
create...
relay log
create...
A
binary log
Client
Table t Table tTransactionapplied here
andapplied here
THENcopied here
THENack'ed
![Page 50: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/50.jpg)
50 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Semi-Synchronous Replication (MySQL 5.5)
create...
B
binary log
create...
relay log
create...insert...A
binary log
Client
Table t1
Table tTransactionapplied here
andapplied here
THENcopied here
THENack'ed
![Page 51: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/51.jpg)
51 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Semi-Synchronous Replication (MySQL 5.5)
create...
B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table tTransactionapplied here
andapplied here
THENcopied here
THENack'ed
![Page 52: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/52.jpg)
52 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Semi-Synchronous Replication (MySQL 5.5)
create...
B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table tTransactionapplied here
andapplied here
THENcopied here
THENack'ed
![Page 53: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/53.jpg)
53 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Semi-Synchronous Replication (MySQL 5.5)
create...
B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table tTransactionapplied here
andapplied here
THENcopied here
THENack'ed
1
2
Slave tells masterwhen to ack!
![Page 54: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/54.jpg)
54 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Semi-Synchronous Replication (MySQL 5.5)
create...insert...B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table t1Transaction
applied hereand
applied hereTHEN
copied hereTHENack'ed
![Page 55: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/55.jpg)
55 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
What's New inSemi-Synchronous
Replication?
![Page 56: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/56.jpg)
56 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
MySQL 5.5:semi-synchronous replication● Master commit● Slave receive● Client ack
.If master crashesbetween 1 and 2,committed data is lost
.Concurrent clientsmay have seen the transaction
MySQL 5.7.2:loss-less semi-sync replication● Slave receive● Master commit● Client ack
.If master crashes, all committed data is on slave
![Page 57: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/57.jpg)
57 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
create...
B
binary log
create...
relay log
create...
A
binary log
Client
Table t Table tTHEN com-mitted here
andapplied here
Transactioncopied here
andack'ed
![Page 58: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/58.jpg)
58 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
create...
B
binary log
create...
relay log
create...
A
binary log
Client
Table t Table tTHEN com-mitted here
andapplied here
Transactioncopied here
andack'ed
![Page 59: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/59.jpg)
59 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
create...
B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t Table tand
applied hereTHEN com-mitted here
Transactioncopied here
andack'ed
![Page 60: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/60.jpg)
60 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
create...
B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table tand
applied here
Transactioncopied here
andack'ed
THEN com-mitted here
![Page 61: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/61.jpg)
61 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
create...
B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table tand
applied here
Transactioncopied here
1
2
Slave tells masterwhen to commit!
andack'ed
THEN com-mitted here
![Page 62: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/62.jpg)
62 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
create...
B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table tand
applied hereTHEN com-mitted here
Transactioncopied here
andack'ed
![Page 63: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/63.jpg)
63 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
create...insert...
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
create...insert...B
binary log
create...insert...
relay log
create...insert...A
binary log
Client
Table t1
Table t1and
applied hereTHEN com-mitted here
Transactioncopied here
andack'ed
![Page 64: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/64.jpg)
64 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Loss-Less Semi-Sync Replication (MySQL 5.7.2)
Summary● MySQL 5.7.2: loss-less semi-synchronous replication possible● If master crashes, all committed data is on slave● To enable:
master> SET GLOBAL rpl_semi_sync_master_wait_point = AFTER_SYNC;
● (default: AFTER_COMMIT – for 5.5 behavior)
![Page 65: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/65.jpg)
65 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
OverviewMySQL Replication: Discover What's New
Overview: MySQL Replication
Consistency: Lossless Semi-Sync
Slave Throughput: Improved Multi-Threaded Slave
Flexibility: Multi-Source Replication
Monitoring: Performance_Schema Tables
Next steps
![Page 66: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/66.jpg)
66 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
What isMulti-Threaded
Slave?
![Page 67: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/67.jpg)
67 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
Before MySQL 5.6: Single-threaded slave
Improved Multi-Threaded Slave
B
relay logClient
Client
Client
![Page 68: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/68.jpg)
68 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
Before MySQL 5.6: Single-threaded slave
Improved Multi-Threaded Slave
B
relay log
Transactionsapplied
in parallel
Client
Client
Client
Transactionslogged
in sequence
Transactionsapplied
in sequence
![Page 69: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/69.jpg)
69 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
Before MySQL 5.6: Single-threaded slave
Improved Multi-Threaded Slave
B
relay log
Transactionsapplied
in parallel
Client
Client
Client
Transactionslogged
in sequence
Transactionsapplied
in sequence
Bottleneck!
![Page 70: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/70.jpg)
70 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
MySQL 5.6: Multi-threaded slave by database
Improved Multi-Threaded Slave
B
relay log
Transactionsapplied
in parallel
Client
Client
Client
Transactionslogged
in sequence
Transactionsapplied
in parallel
![Page 71: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/71.jpg)
71 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
MySQL 5.6: Multi-threaded slave by database● Different databases go to different threads
Improved Multi-Threaded Slave
B
relay logClient
Client
Client
DB1
DB2
DB3
![Page 72: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/72.jpg)
72 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
MySQL 5.6: Multi-threaded slave by database● Different databases go to different threads● Great for some applications, BUT:
● No improvement if there is only one database● May break cross-database consistency
Improved Multi-Threaded Slave
B
relay logClient
Client
Client
DB1
DB2
DB3
![Page 73: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/73.jpg)
73 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
What's New inMulti-Threaded
Slave?
![Page 74: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/74.jpg)
74 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
MySQL 5.7.2: Multi-threaded slave by master concurrency● Transactions that were prepared at the same time on master
cannot conflict● Master stores a logical timestamp in the binary log● Slave applies transactions with same timestamp in parallel
Improved Multi-Threaded Slave
B
relay logClient
Client
Client
![Page 75: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/75.jpg)
75 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
MySQL 5.7.2: Multi-threaded slave by master concurrency● Works always
● Even for one-database applications● Consistent
Improved Multi-Threaded Slave
B
relay logClient
Client
Client
![Page 76: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/76.jpg)
76 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
A
binary log
MySQL 5.7.2: Multi-threaded slave by master concurrency● To enable:
slave> SET GLOBAL slave_parallel_type = logical_clock;
(default: database – for 5.6 behavior)
Improved Multi-Threaded Slave
B
relay logClient
Client
Client
![Page 77: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/77.jpg)
77 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
OverviewMySQL Replication: Discover What's New
Overview: MySQL Replication
Consistency: Lossless Semi-Sync
Slave Throughput: Improved Multi-Threaded Slave
Flexibility: Multi-Source Replication
Monitoring: Performance_Schema Tables
Next steps
![Page 78: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/78.jpg)
78 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
What isMulti-SourceReplication?
![Page 79: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/79.jpg)
79 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
Before: Slave can have one master Labs release: Slave can have multiple masters
SM
M
![Page 80: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/80.jpg)
80 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
Note● No conflict detection/resolution● Not update everywhere● Not synchronous
The masters must have conflict-free workloads!
![Page 81: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/81.jpg)
81 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
Slave can have multiple masters
Preview release: labs.mysql.com● Not for production yet● Known and unknown limitations and bugs● Try it out and give feedback!
SM
M
![Page 82: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/82.jpg)
82 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Why UseMulti-SourceReplication?
![Page 83: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/83.jpg)
83 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replicationfor Data Analytics
Business IntelligenceData analytics
Backupetc
M
M
M
Database 2
Database 3
Database 1
SDatabase 1, 2, 3
![Page 84: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/84.jpg)
84 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replicationfor Merging Shards
M
M
Shard 2
Shard 1
SNew Shard
![Page 85: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/85.jpg)
85 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
How DoesMulti-Source
Work?
![Page 86: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/86.jpg)
86 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
relay log
relay log
relay log
A
B
C
D
![Page 87: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/87.jpg)
87 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source + Multi-Threaded
relay log
relay log
relay log
A
B
C
D
![Page 88: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/88.jpg)
88 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
D
relay log
relay log
relay log
A
B
C
D
Channel = Full slave pipeline
![Page 89: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/89.jpg)
89 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
D
relay log
relay log
relay log
A
B
C
D
Channel = Full slave pipeline
Channels are named
my_channel
another_channel
third_channel
![Page 90: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/90.jpg)
90 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
Setting up CHANGE MASTER TO […] FOR CHANNEL = 'name'
![Page 91: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/91.jpg)
91 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
Other replication commands: START SLAVE […] FOR CHANNEL = 'name' STOP SLAVE […] FOR CHANNEL = 'name' RESET SLAVE […] FOR CHANNEL = 'name' FLUSH RELAY LOGS FOR CHANNEL = 'name' SHOW RELAY LOG EVENTS FOR CHANNEL = 'name'
START SLAVE […] FOR ALL CHANNELS STOP SLAVE […] FOR ALL CHANNELS RESET SLAVE […] FOR ALL CHANNELS
SELECT MASTER_POS_WAIT('file', pos[, timeout][, 'channel'])
![Page 92: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/92.jpg)
92 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Multi-Source Replication
Compatibility CHANGE MASTER TO […] (with no channel specified) START SLAVE […] (with no channel specified) etc
… are the same as …
CHANGE MASTER TO […] FOR CHANNEL = '' START SLAVE […] FOR CHANNEL = '' etc
![Page 93: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/93.jpg)
93 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
OverviewMySQL Replication: Discover What's New
Overview: MySQL Replication
Consistency: Lossless Semi-Sync
Slave Throughput: Improved Multi-Threaded Slave
Flexibility: Multi-Source Replication
Monitoring: Performance_Schema Tables
Next steps
![Page 94: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/94.jpg)
94 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
Traditional replication monitoring:SHOW SLAVE STATUS;
– Simple
– Not SQL friendly – no WHERE, no joins, etc
– Multi-source has per-source status
– Multi-threaded slave has per-applier status
5.7.2: Performance_Schema tables for replication slave
![Page 95: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/95.jpg)
95 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
relay log
execute statusby coordinator
execute statusby worker
executeconfiguration
executestatus
connectionconfiguration
connectionstatus
![Page 96: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/96.jpg)
96 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
6 tables in performance_schema database:
replication_connection_configuration
replication_connection_status
replication_execute_configuration
replication_execute_status
replication_execute_status_by_coordinator
replication_execute_status_by_worker Consistent semantics across tables Consistent naming across tables
One row for each workerin each multi-source channel
One rowfor each
multi-sourcechannel
![Page 97: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/97.jpg)
97 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
Example: Connection statusmysql> select * from performance_schema.replication_connection_status\G*************************** 1. row *************************** CHANNEL_NAME: CHANNEL1 SOURCE_UUID: 7cff740623ca11e3ac3e5c260a83b12b THREAD_ID: 13 SERVICE_STATE: ONRECEIVED_TRANSACTION_SET: 7cff740623ca11e3ac3e5c260a83b12b:14 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 00000000 00:00:00*************************** 2. row *************************** CHANNEL_NAME: CHANNEL2
⋮ One row for each channel
![Page 98: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/98.jpg)
98 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
Example: Connection statusmysql> select * from performance_schema.replication_connection_status\G*************************** 1. row *************************** CHANNEL_NAME: CHANNEL1 SOURCE_UUID: 7cff740623ca11e3ac3e5c260a83b12b THREAD_ID: 13 SERVICE_STATE: ONRECEIVED_TRANSACTION_SET: 7cff740623ca11e3ac3e5c260a83b12b:14 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 00000000 00:00:00*************************** 2. row *************************** CHANNEL_NAME: CHANNEL2
⋮ The master's server_uuid
![Page 99: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/99.jpg)
99 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
Example: Connection statusmysql> select * from performance_schema.replication_connection_status\G*************************** 1. row *************************** CHANNEL_NAME: CHANNEL1 SOURCE_UUID: 7cff740623ca11e3ac3e5c260a83b12b THREAD_ID: 13 SERVICE_STATE: ONRECEIVED_TRANSACTION_SET: 7cff740623ca11e3ac3e5c260a83b12b:14 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 00000000 00:00:00*************************** 2. row *************************** CHANNEL_NAME: CHANNEL2
⋮ Thread id and status
![Page 100: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/100.jpg)
100 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
Example: Connection statusmysql> select * from performance_schema.replication_connection_status\G*************************** 1. row *************************** CHANNEL_NAME: CHANNEL1 SOURCE_UUID: 7cff740623ca11e3ac3e5c260a83b12b THREAD_ID: 13 SERVICE_STATE: ONRECEIVED_TRANSACTION_SET: 7cff740623ca11e3ac3e5c260a83b12b:14 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 00000000 00:00:00*************************** 2. row *************************** CHANNEL_NAME: CHANNEL2
⋮ Set of transactionsreceived through this channel
![Page 101: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/101.jpg)
101 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
Example: Connection statusmysql> select * from performance_schema.replication_connection_status\G*************************** 1. row *************************** CHANNEL_NAME: CHANNEL1 SOURCE_UUID: 7cff740623ca11e3ac3e5c260a83b12b THREAD_ID: 13 SERVICE_STATE: ONRECEIVED_TRANSACTION_SET: 7cff740623ca11e3ac3e5c260a83b12b:14 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 00000000 00:00:00*************************** 2. row *************************** CHANNEL_NAME: CHANNEL2
⋮ Error status
![Page 102: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/102.jpg)
102 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
Example: Connection statusmysql> select * from performance_schema.replication_connection_status\G*************************** 1. row *************************** CHANNEL_NAME: CHANNEL1 SOURCE_UUID: 7cff740623ca11e3ac3e5c260a83b12b THREAD_ID: NULL SERVICE_STATE: OFFRECEIVED_TRANSACTION_SET: 7cff740623ca11e3ac3e5c260a83b12b:14 LAST_ERROR_NUMBER: 1045 LAST_ERROR_MESSAGE: error connecting to master 'me@host:13000' … LAST_ERROR_TIMESTAMP: 20131109 21:03:23*************************** 2. row *************************** CHANNEL_NAME: CHANNEL2
⋮
Error status
![Page 103: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/103.jpg)
103 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Monitoring with Performance_Schema
Example: Connection statusmysql> select * from performance_schema.replication_connection_status\G*************************** 1. row *************************** CHANNEL_NAME: CHANNEL1 SOURCE_UUID: 7cff740623ca11e3ac3e5c260a83b12b THREAD_ID: NULL SERVICE_STATE: OFFRECEIVED_TRANSACTION_SET: 7cff740623ca11e3ac3e5c260a83b12b:14 LAST_ERROR_NUMBER: 1045 LAST_ERROR_MESSAGE: error connecting to master 'me@host:13000' … LAST_ERROR_TIMESTAMP: 20131109 21:03:23*************************** 2. row *************************** CHANNEL_NAME: CHANNEL2
⋮
Thread stoppedon error
![Page 104: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/104.jpg)
104 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
OverviewMySQL Replication: Discover What's New
Overview: MySQL Replication
Consistency: Lossless Semi-Sync
Slave Throughput: Improved Multi-Threaded Slave
Flexibility: Multi-Source Replication
Monitoring: Performance_Schema Tables
Next steps
![Page 105: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/105.jpg)
105 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Try it out!● MySQL 5.6:
http://dev.mysql.com/downloads/mysql/● MySQL 5.7.4:
http://dev.mysql.com/downloads/mysql/5.7.html● Labs release:
http://labs.mysql.com
Read the manual!● http://dev.mysql.com/doc/refman/5.7/en/index.html
Next Steps
![Page 106: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/106.jpg)
106 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Send us feedback!● Shivji Kumar Jha
[email protected]● Sven Sandberg
[email protected]● Luís Soares
File bugs!● http://bugs.mysql.com
Next Steps
![Page 107: MySQL Developer Day conference: MySQL Replication and Scalability](https://reader034.fdocuments.in/reader034/viewer/2022042714/54c6748f4a795972238b4569/html5/thumbnails/107.jpg)
107 | Copyright © 2014, Oracle and/or its affiliates. All rights reserved.