What’s new in Galera 4 ?
Mydbops Meetup - 4
Presented by
M.Aakash
www.mydbops.com info@mydbops.com 1
About me
2
Aakash Muthuramalingam
Certified MySQL 5.7 DBA, Mydbops
Interested on MySQL Optimization and High Availability systems.
Active MySQL Blogger.
LinkedIn :
https://www.linkedin.com/in/aakash-muthuramalingam-520a77129
Twitter: https://twitter.com/Aakash_07
About Mydbops
● Founded in 2015, HQ in Bangalore India with 150+ customer base across the globe.
● Mydbops is on Database Consulting with core specialization on MySQL and MongoDB Administration and
Support.
● We have expert team with 20+ certified DBA’s providing full time support and currently managing 300+
servers on premises and cloud.
● We help organisations to architect and scale systems in MySQL/MongoDB by implementing the advanced
technologies in industry which are completely open source.
● We are a leading solution provider in the market for all sort of cloud based database deployments and
management.
3
Mydbops at a GlanceHappy Customers
4
Agenda
● Galera Replication Overview
● Galera 4 features
● Streaming Replication
● Configuring Streaming Replication
● Rolling Upgrade
● Other features
5
Galera Replication Overview
6
Replication in MySQL
● Asynchronous Replication
● Semi-synchronous Replication
● Synchronous Replication
7
Asynchronous Replication
8
Semi Synchronous Replication
9
Synchronous Replication
10
Galera Replication Overview
● Replication Plugin for database servers
● Using the Replication API to interact with a DBMS.
● Database and Galera plugin must have the same
11
Galera Replication Overview
Galera Cluster Basic Architecture
12
Galera Replication Overview
● Read/Write to any node
● Automatic Node Provisioning
● Each node has identical data
● Synchronous Replication
● No Slave Lag
13
Galera Replication Overview
● Distributions:
14
Galera 3 Galera 4
MariaDB 5.5, 10.0, 10.1, 10.2 ,10.3 MariaDB 10.4
Percona XtraDB Cluster 5.5, 5.6, 5.7 Percona XtraDB Cluster 8.0 (In
Development Phase)
Features
15
Galera Features
Galera 3(Existing Features)
● Intelligent Donor Selection
● Cluster Crash Recovery
Galera 4(New Features)
● Huge Transaction Support by Streaming Replication
● New metadata tables
16
Existing Features
17
Intelligent Donor Selection
18
Intelligent Donor Selection
● Intelligent donor choice:
1) Provide IST
2) Within same proximity
3) wsrep_sst_donor
19
Cluster Crash Recovery
20
Cluster Crash Recovery
21
Cluster Crash Recovery
22
Cluster Crash Recovery
23
Cluster Crash Recovery
24
Cluster Crash Recovery
25
Cluster Crash Recovery
● If all the nodes in the cluster shutdown
1) First node should be elected
2) Manual operation needed
3) Error Prone
26
Cluster Crash Recovery
● Perform automatic crash recovery
● pc.recovery=on
● Nodes will maintain the information in disk (Persistent storage)
● gvwstate.dat
27
New Features
28
Streaming Replication
29
Streaming Replication
In Galera 3
● Currently transactions processes in master node only until commit
● For huge transactions, the size of write-set will be large
● wsrep_max_ws_size
● wsrep_max_ws_rows
● Maximum supported size is 2GB
30
Streaming Replication
31
T1
Streaming Replication
32
T1
Streaming Replication
33
T1
Streaming Replication
34
T1
Streaming Replication
35
T1
Streaming Replication
In Galera 4
● Transactions are replicated in small fragments in all the nodes during processing
● This allows nodes to process writesets greater than 2GB
● Replicated fragments hold locks in all nodes
36
Streaming Replication
Configuring Streaming Replication
● wsrep_trx_fragment_unit - bytes/rows/statements
● wsrep_trx_fragment_size - Threshold size
37
Streaming Replication
38
T1
T1(p1)
T1(p1)
T1(p1)
Streaming Replication
39
T1
T1(p2)
T1(p2)
T1(p2)
Streaming Replication
40
T1
Fragment Applying
41
Fragment Applying
42
Fragment Applying
43
Fragment Applying
44
Fragment Applying
45
Fragment Applying
46
Fragment Applying
47
New Metadata Tables
48
New Metadata Tables
49
New Metadata Tables
50
New Metadata Tables
51
New Metadata Tables
52
Streaming Replication Demo
53
Node 1 (Galera 3)
54
Node 2 (Galera 3)
55
Node 1 (Galera 4)
56
Node 2 (Galera 4)
57
Node 2 (Galera 4)
58
Node 2 (Galera 4)
59
Rolling Upgrades
60
Rolling Upgrades
61
Rolling Upgrades
62
Rolling Upgrades
63
Rolling Upgrades
64
Rolling Upgrades
65
Rolling Upgrades
66
Rolling Upgrades
67
Rolling Upgrades
68
Rolling Upgrades
69
Other Features
70
Other Features
● Non Blocking DDL
● Gcache Encryption
● Cluster Error Voting
71
Summary
● Replication in MySQL
● Galera Features
● Streaming Replication
● Rolling Upgrades
● Streaming Replication Examples
72
Queries?
73
Thank You
74

What is new in Galera 4 ?