SlideShare a Scribd company logo
1 of 60
Download to read offline
Group Replication
Ramesh Sivaraman
QA Engineer
Kenny Gryp
MySQL Practice Manager
Us
2 / 60
Table of Contents
 
1. Overview
2. Similarities
3. Differences GR & Galera
4. Differences PXC & Galera
5. Limitations
6. Known Issues
7. QA
8. Performance Tests
3 / 60
Different Technologies
Overview
4 / 60
Galera Cluster
Developed by Codership
http://galeracluster.com
Included in MariaDB
Galera Cluster is a synchronous multi-master database
cluster, based on synchronous replication and Oracle’s
MySQL/InnoDB. When Galera Cluster is in use, you can direct
reads and writes to any node, and you can lose any
individual node without interruption in operations and
without the need to handle complex failover procedures.
Replication is synchronous, Applying is asynchronous
5 / 60
Percona XtraDB Cluster
Patched Galera Cluster, developed by Percona
https://www.percona.com/software/mysql-
database/percona-xtradb-cluster
Generally Available Since April 2012
With additional features
Extended PFS support
SST/XtraBackup Changes
Bug-Fixes
PXC Strict mode *
ProxySQL integration *
Performance Enhancements *
6 / 60
MySQL Group Replication
Developed by Oracle
Generally Available in MySQL 5.7.17 on December 2016
MySQL InnoDB Cluster as Solution
MySQL Group Replication is a MySQL Server plugin that
provides distributed state machine replication with strong
coordination between servers. Servers coordinate
themselves automatically, when they are part of the same
replication group. Any server in the group can process
updates. Con icts are detected and handled automatically.
There is a built-in membership service that keeps the view
of the group consistent and available for all servers at any
given point in time. Servers can leave and join the group and
the view will be updated accordingly.
7 / 60
MySQL InnoDB Cluster
8 / 60
They have a lot in common
Similarities
9 / 60
Similarities
MySQL/MariaDB
Replication Method
Data centric - All nodes have all data
Reads happen on the local node only
All require InnoDB/XtraDB as Storage Engine
Active-active multi-master Topology
Write to multiple nodes
No complex/external failover necessary
Node membership: join/leave automatically
Execute writes in Global Total Order
Consistency!
Optimistic Locking / First Committer Wins
Quorum - split brain prevention 10 / 60
Similar - Use Cases
Environments with strict durability requirements
Write to multiple nodes simultaneously while keeping
data consistent
Reduce failover time
11 / 60
Similar Limitations
Large & Long running transactions
Higher chance on failures
non-e cient replication of large transations
Workload hotspots (updating same set of rows in
parallel)
Often writing to 1 node is the best solution
12 / 60
Group Replication vs. Galera Based
Differences
13 / 60
Differences
Group Communication System
Binlogs & Gcache
Node Provisioniong
GTID vs. Seqno
Partition Handling
Full Solution or Plugin
Flow Control
WAN Support
OS Support
Schema Changes
14 / 60
Group Communication
Galera:
Totem Single-ring Ordering
All nodes have to ACK message
Group Replication:
Xcom, similar to Paxos Mencius
Paxos only requires majority of nodes to ACK the
message in order
15 / 60
Binlogs & GCache
Galera Cluster/PXC:
uses binlog row events
but does not require binary logging
writes events to Gcache (con gurable size)
Group Replication:
requires binary logging
16 / 60
Node Provisioning
Galera Cluster/PXC:
has State Snapshot Transfer (SST):
Percona XtraBackup (Recommended)
rsync
mysqldump
incremental State Transfer (IST) using GCache
MySQL Group Replication:
currently no automatic provisioning
restoring a backup is required
asynchronous replication channel for syncing
17 / 60
GTID vs. Seqno
MySQL Group Replication:
built around MySQL GTID.
writes to a cluster create GTID events on the GR
Cluster UUID
Galera Cluster/PXC:
has a seqno which is a incrementing number
18 / 60
Partition Handling
Galera Cluster/PXC:
A partitioned node will refuse reads/writes (con gurable)
A partitioned node will automatically recover and rejoin
Group Replication:
A partitioned node will accept reads
A partitioned node will accept write requests, but will
hang forever
A partitioned node needs to be manually rejoined to the
cluster
19 / 60
Full Solution or Plugin
Plugin:
Group Replication is a 'Replication Plugin'
several split brain issues in current code
Solution:
Galera Cluster, handling application connections is not
included
strong split brain prevention compared to current GR
MySQL InnoDB Cluster (w. MySQLRouter)
Full Solution:
Percona XtraDB Cluster (w. ProxySQL)
integrated ProxySQL
strict mode prevents limitations from being used
20 / 60
Flow Control
Prevent a slower node from getting too far behind
Galera Cluster/PXC:
block all writes in cluster when a node reaches
fc_limit
ow control message is sent
low defaults; Galera: 16(*), PXC: 100
MySQL Group Replication:
every node has statistics about every member
each individual node decides to throttle writes
high default: 25000
21 / 60
WAN Support
MySQL Group Replication:
not recommended for WAN
Galera Based Systems have WAN features:
Weighted Quorum
Tunable network communication settings
Reduce network tra c with segments
Arbitrator
22 / 60
Operating System Support
Galera:
FreeBSD & Linux
Percona XtraDB Cluster:
Linux
Group Replication:
Linux, Windows, Solaris, OSX, FreeBSD
23 / 60
Schema Changes - DDL
Galera Cluster/PXC:
Total Order Isolation:
All writes will be blocked during
Writes on other nodes will be terminated
Workarounds:
pt-online-schema-change
wsrep_osu_method=RSU
More operational work
Not for all DDL's
Group Replication:
DDL does not block all writes, behaves like regular
InnoDB
24 / 60
Percona XtraDB Cluster vs. Galera
Differences
25 / 60
Percona XtraDB Cluster vs
Galera Cluster
PXC has additional features:
Extended PFS support
SST/XtraBackup Changes
Bug-Fixes
PXC Strict mode *
ProxySQL integration *
Performance Enhancements *
26 / 60
PXC Strict Mode
Prevent experimental/unsupported features:
Only Allow InnoDB Operations
Prevent Changing binlog_format!=ROW
Require Primary Key on tables
Disable Unsupported Features:
GET_LOCK, LOCK TABLES, CTAS
FLUSH TABLES <tables> WITH READ LOCK
tx_isolation=SERIALIZABLE
27 / 60
ProxySQL Integration
PXC includes ProxySQL as load balancer:
proxysql-admin con guration tool
ProxySQL schedulers :
Health Checks
Recon gures Nodes
PXC Maintenance Mode
Tell load balancer to rebalance load
28 / 60
Performance Enhancements
Several Scalability Fixes in PXC 5.7.17
New Defaults:
gcs.fc_limit=100
evs.send_window=10
evs.user_send_window=4
29 / 60
be aware of
Limitations
30 / 60
Limitations - Galera Cluster/PXC
Does not work as expected:
InnoDB/XtraDB Only
tx_isolation=SERIALIZABLE
GET_LOCK()
LOCK TABLES
SELECT ... FOR UPDATE
Careful with ALTER TABLE ... IMPORT/EXPORT.
Capped maximum transaction size
XA transactions
31 / 60
Limitations - Group Replication
Does not work as expected:
InnoDB/XtraDB Only
tx_isolation=SERIALIZABLE
GET_LOCK()
LOCK TABLES
SELECT ... FOR UPDATE
Careful with ALTER TABLE ... IMPORT/EXPORT.
Careful with large transactions
no support for tables with multi-level foreign key
dependencies, can create inconsistencies
32 / 60
nothing is perfect
Known Issues
33 / 60
Galera Cluster/PXC - Issues
Crashes due to background thread handling trx
processing
mysql-wsrep#306: stored procedure aborts
mysql-wsrep#305: event scheduler
mysql-wsrep#304: local scope functions such as
CURRENT_USER()
Various crashes related to DDL:
mysql-wsrep#301: running SHOW CREATE TABLE
in multiple nodes with DDL can cause crash.
mysql-wsrep#275: Aborting trx leaves behind open
tables in cache can cause crash
34 / 60
Galera Cluster/PXC - Issues
Concurrent DDLs using wsrep_OSU_method=RSU
crash/inconsistency issues
mysql-wsrep#283 & mysql-wsrep#282
Shutdown issues:
mysql-wsrep#303: cleanup during shutdown fails to
clear the EXPLICT MDL locks (FTWRL)
mysql-wsrep#273: Not getting clean shutting down
message if we start the server with unknown
variable
mysql-wsrep#279: Trying to access stale binlog
handler leads to crash 35 / 60
Group Replication - Issues
Partition Tolerance issues, split brain cannot be prevented:
#84727: partitioned nodes still accept writes: queries
hang
#84728: GR failure at start still starts MySQL
#84729: block reads on partitioned nodes
#84733: not possible to start with super_read_only=1
(Fixed in 8.0)
#84784: Nodes Do Not Reconnect
#84795: STOP GROUP_REPLICATION sets
super_read_only=off
#84574: DDL execute on partitioned node leads to split
brain
36 / 60
Group Replication
Reduce impact on applications:
#84731: mysql client connections get stuck during GR
start
Stability:
#84785: Prevent Large Transactions in Group
Replication
#84792: Member using 100% CPU in idle cluster
#84796: GR Member status is wrong
37 / 60
Group Replication
Usability:
#84674: unresolved hostnames block GR from starting
(Fixed in 5.7.18)
#84794: cannot kill query that is stuck inside GR
#84798: Group Replication can use some verbosity in the
error log
38 / 60
but we try to make it perfect
Quality Assurance
39 / 60
MySQL Test Suite
MySQL Group Replication has an extensive MTR test
suite, which covers member join primitives and recovery,
member state change, query handling, concurrency,
stress etc.
Galera as well as Percona XtraDB Cluster uses its own
MTR testsuite (not as extensive as mysql group
replication) to test recovery, member state change, query
handling, concurrency, stress etc.
40 / 60
pquery
pquery is an open-source (GPLv2 licensed) multi-
threaded test program created for stress testing the
MySQL server (in any avor), either randomly or
sequentially, for QA purposes.
To test Group Replication, Percona XtraDB Cluster and
Galera we improved our existing pquery cluster
framework. This framework will start a 3 node cluster and
run pquery against these cluster nodes.
41 / 60
pquery
pquery is mainly used for "Random Spread Testing" using
a rich set of sql statement combinations. We have
extracted these SQL statements from the MTR testsuite
using a MTR to SQL convertor script (mtr_to_sql.sh)
42 / 60
pquery features
20+ Coredumps (crashes/asserts) per hour
Fully automatic testcase creation
C++ core
120 Seconds per trial run time
Thousands of SQL lines executed per trial
Compatible with sporadic issues
High end automation
Ultra fast testcase reduction
Full framework
43 / 60
pquery framework
44 / 60
Group Replication pquery run resultset
$ ~/percona-qa/pquery-results.sh
================ [Run: 466282] Sorted unique issue strings
(1000 trials executed, 1557 remaining reducer scripts)
head->variables.gtid_next.ty (Seen 16 times: reducers [107-2,3]
. is_set (Seen 40 times: reducers [9-1] ...
key .= 64U (Seen 1 times: reducers [268-1] )
.length % 4 (Seen 47 times: reducers [7-1] ...
m_pos.m_index_1 < mi->rli-> (Seen 3 times: reducers [257-1] ..
rem0rec.cc line 867 (Seen 1 times: reducers [515-1] )
.slen % 2 (Seen 24 times: reducers [6-1] ...
.slen % 4 (Seen 12 times: reducers [116-1] ..
sort_field->length >= length (Seen 5 times: reducers [30-1] ...
..thd (Seen 283 times: reducers [1-1] ...
.thd->is_error (Seen 1 times: reducers [393-1] )
thd->lex->sql_command == SQLCOM_XA_COMMIT (Seen 2 times: reducers [576-1] )
thd->mdl_con... (Seen 2 times: reducers [194-1] ..
.tlen % 2 (Seen 57 times: reducers [55-1] ..
.tlen % 4 (Seen 24 times: reducers [34-1] ...
Z10read_tokenPK18sql_digest_storagejPj (Seen 6 times: reducers [173-1] .
45 / 60
Group Replication pquery run sample
testcase
Out of 1000 pquery trials GR crashed 283 times with
similar assertion message:
handle_fatal_signal (sig=6) in
Gtid_table_access_context::init
https://bugs.mysql.com/bug.php?id=85364
Generated reduced testcase using reducer.sh
DROP DATABASE test;
ALTER t t0ADD c c0CHAR exist;
XA START 'xid0';
SET @@GLOBAL.binlog_checksum=NONE;
46 / 60
Percona XtraDB Cluster pquery run
resultset:
$ ~/percona-qa/pquery-results.sh
================ [Run: 987219] Sorted unique issue strings
(1000 trials executed, 724 remaining reducer scripts)
false (Seen 26 times: reducers [60-1,2
get_state (Seen 7 times: reducers [513-3]
. is_set (Seen 25 times: reducers [36-1]
.length % 4 (Seen 31 times: reducers [23-2]
.mdl_context.has_locks (Seen 4 times: reducers [122-2]
.thd->is_current_stmt_binlog_format_row (Seen 12 times: reducers [163-1]
thd->mdl_context.owns_equal... (Seen 3 times: reducers [4-2] .
thd->security_context (Seen 69 times: reducers [45-2,3
.tlen % 2 (Seen 30 times: reducers [21-3]
.tlen % 4 (Seen 25 times: reducers [56-2]
trx0sys.cc line 354 (Seen 3 times: reducers [617-2]
trx0trx.cc line 389 (Seen 41 times: reducers [40-3]
ut0ut.cc line 917 (Seen 6 times: reducers [455-3]
ZN12ha_myisammrg18append_create_infoEP6String (Seen 230 times: reducers [9-1] .
ZN3THD21send_statement_statusEv (Seen 6 times: reducers [697-3]
ZN8MDL_lock28has_pendi (Seen 7 times: reducers [519-3]
47 / 60
Percona XtraDB Cluster pquery run
sample testcase
Out of 1000 pquery trials PXC crashed 69 times with
similar assertion message:
Assertion failed
thd->security_context()->user().str
https://github.com/codership/mysql-
wsrep/issues/304
Reduced testcase
Start 2 node cluster
Execute following on one of the node
"ALTER USER CURRENT_USER() IDENTIFIED BY 'abcd2';"
48 / 60
Startup scripts
As part of QA testing we have made some handy scripts
to start multiple Percona XtraDB Cluster/Galera/Group
Replication nodes on the y.
These scripts are available in the Percona-
QA/percona-qa github project. Currently these scripts
supports binary tarball distributions only.
49 / 60
PXC/Galera startup script
For PXC/Galera run percona-qa/pxc-startup.sh
script from the Percona XtraDB Cluster basedir. It will
generate a PXC startup script called start_pxc
$ git clone 
https://github.com/Percona-QA/percona-qa
$ cd <PXC_BASE>
$ ~/percona-qa/pxc-startup.sh
Adding script: ./start_pxc
./start_pxc will create ./stop_pxc | ./*node_cli
| ./wipe scripts
$ ./start_pxc 5
Starting PXC nodes..
$
50 / 60
Group Replication startup script
For Group Replication run percona-qa/startup.sh
script from Group Replication basedir. It will generate a
GR startup script called start_group_replication
$ cd <MySQL BASE>
$ ~/percona-qa/startup.sh
Adding scripts: start | start_group_replication |
start_valgrind | start_gypsy | stop | kill |
setup | cl | test | init | wipe | all | prepare |
run | measure | tokutek_init
Setting up server with default directories
[..]
$
51 / 60
Group Replication startup script
$ ./start_group_replication 3
Starting 3 node Group Replication, please wait...
Started node1.
Started node2.
Started node3.
Added scripts: | 1cl | 2cl | 3cl
| wipe_group_replication | stop_group_replication
Started 3 Node Group Replication.
[..]
$
52 / 60
benchmark-eating
Performance Tests
53 / 60
Performance Tests
Performance comparison between Percona XtraDB
Cluster, Galera and Group Replication.
Workload : Sysbench OLTP_RW, UPDATE_KEY and
UPDATE_NOKEY
Table count : 100 (4 millions rows each)
Data Size : 100GB
Cluster : 3 Node
https://www.percona.com/blog/2017/04/19/performance-
improvements-percona-xtradb-cluster-5-7-17/
54 / 60
Performance Tests
Sysbench OLTP_RW, UPDATE_KEY and UPDATE_NOKEY
workloads with 100 tables (sync_binlog=1)
55 / 60
Performance Tests
Sysbench OLTP_RW, UPDATE_KEY and UPDATE_NOKEY
workloads with 100 tables (sync_binlog=0)
56 / 60
Performance Tests
Cluster node joining speed performance.
Testcase
Shutdown one node from 3 node cluster
Sysbench run (create single table)
Start the node which was o ine.
Check node status
With PXC script will check
wsrep_local_state_comment status
With Group Replication script will check replication
group ONLINE status.
57 / 60
Performance Tests
Cluster node joining speed performance graph.
(smaller is better)
58 / 60
Summary
Galera PXC GR/MIC
Automatic Node Provisioning ✓ ✓
Load Balancer Integration ✓ ✓
Enforcing Best Practices ✓ ✓
Partition Handling ✓ ✓
Mature Technology ✓ ✓
Multi-Master ✓ ✓ ✓
WAN Support ✓ ✓
OS Support ✓ ✓ ✓
Performance ✓ ✓
Supported By Percona ✓ ✓ ✓
59 / 60
Ramesh Sivaraman Kenny Gryp
just a few
Questions?
60 / 60

More Related Content

What's hot

What's hot (20)

MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
 
ProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdfProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdf
 
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL ShellMySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
MySQL InnoDB Cluster: Management and Troubleshooting with MySQL Shell
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
 
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoMySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & Demo
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB Cluster
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
Planning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera ClusterPlanning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera Cluster
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview
 
Maxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoinMaxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoin
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
 
MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptx
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
 

Viewers also liked

MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
Ronald Bradford
 

Viewers also liked (20)

MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
 
10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group Replication
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Inno db internals innodb file formats and source code structure
Inno db internals innodb file formats and source code structureInno db internals innodb file formats and source code structure
Inno db internals innodb file formats and source code structure
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Using Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data AnalysisUsing Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data Analysis
 
淘宝数据库架构演进历程
淘宝数据库架构演进历程淘宝数据库架构演进历程
淘宝数据库架构演进历程
 
Extensible Data Modeling
Extensible Data ModelingExtensible Data Modeling
Extensible Data Modeling
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting Replication
 
Мониторинг и отладка MySQL: максимум информации при минимальных потерях
Мониторинг и отладка MySQL: максимум информации при минимальных потеряхМониторинг и отладка MySQL: максимум информации при минимальных потерях
Мониторинг и отладка MySQL: максимум информации при минимальных потерях
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyMySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
 
Mysql For Developers
Mysql For DevelopersMysql For Developers
Mysql For Developers
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
 
Group Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication CoreGroup Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication Core
 
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication SetupsMix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Java MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & OptimizationJava MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & Optimization
 
Mastering InnoDB Diagnostics
Mastering InnoDB DiagnosticsMastering InnoDB Diagnostics
Mastering InnoDB Diagnostics
 

Similar to Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication

ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
Derek Downey
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
Lenz Grimmer
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
Louis liu
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
Kenny Gryp
 
SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4
UniFabric
 

Similar to Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication (20)

Galera Mysql
Galera MysqlGalera Mysql
Galera Mysql
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
 
Percona XtraDB 集群文档
Percona XtraDB 集群文档Percona XtraDB 集群文档
Percona XtraDB 集群文档
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 
MySQL 5.7 clustering: The developer perspective
MySQL 5.7 clustering: The developer perspectiveMySQL 5.7 clustering: The developer perspective
MySQL 5.7 clustering: The developer perspective
 
Percona XtraDB Cluster ( Ensure high Availability )
Percona XtraDB Cluster ( Ensure high Availability )Percona XtraDB Cluster ( Ensure high Availability )
Percona XtraDB Cluster ( Ensure high Availability )
 
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding MySQL 5.7 Fabric: Introduction to High Availability and Sharding
MySQL 5.7 Fabric: Introduction to High Availability and Sharding
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
 
Fudcon talk.ppt
Fudcon talk.pptFudcon talk.ppt
Fudcon talk.ppt
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
ZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet SpotsZFS and MySQL on Linux, the Sweet Spots
ZFS and MySQL on Linux, the Sweet Spots
 
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisationMySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
 
PoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HAPoC: Using a Group Communication System to improve MySQL Replication HA
PoC: Using a Group Communication System to improve MySQL Replication HA
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
 
SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4
 
Highly Available Load Balanced Galera MySql Cluster
Highly Available Load Balanced  Galera MySql ClusterHighly Available Load Balanced  Galera MySql Cluster
Highly Available Load Balanced Galera MySql Cluster
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
 
JCConf 2016 - Cloud Computing Applications - Hazelcast, Spark and Ignite
JCConf 2016 - Cloud Computing Applications - Hazelcast, Spark and IgniteJCConf 2016 - Cloud Computing Applications - Hazelcast, Spark and Ignite
JCConf 2016 - Cloud Computing Applications - Hazelcast, Spark and Ignite
 

More from Kenny Gryp

More from Kenny Gryp (8)

MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08
 
MySQL Operator for Kubernetes
MySQL Operator for KubernetesMySQL Operator for Kubernetes
MySQL Operator for Kubernetes
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
 
MySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRVMySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRV
 
MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackup
 

Recently uploaded

原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Monica Sydney
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
F
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 

Recently uploaded (20)

20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 

Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication

  • 2. Ramesh Sivaraman QA Engineer Kenny Gryp MySQL Practice Manager Us 2 / 60
  • 3. Table of Contents   1. Overview 2. Similarities 3. Differences GR & Galera 4. Differences PXC & Galera 5. Limitations 6. Known Issues 7. QA 8. Performance Tests 3 / 60
  • 5. Galera Cluster Developed by Codership http://galeracluster.com Included in MariaDB Galera Cluster is a synchronous multi-master database cluster, based on synchronous replication and Oracle’s MySQL/InnoDB. When Galera Cluster is in use, you can direct reads and writes to any node, and you can lose any individual node without interruption in operations and without the need to handle complex failover procedures. Replication is synchronous, Applying is asynchronous 5 / 60
  • 6. Percona XtraDB Cluster Patched Galera Cluster, developed by Percona https://www.percona.com/software/mysql- database/percona-xtradb-cluster Generally Available Since April 2012 With additional features Extended PFS support SST/XtraBackup Changes Bug-Fixes PXC Strict mode * ProxySQL integration * Performance Enhancements * 6 / 60
  • 7. MySQL Group Replication Developed by Oracle Generally Available in MySQL 5.7.17 on December 2016 MySQL InnoDB Cluster as Solution MySQL Group Replication is a MySQL Server plugin that provides distributed state machine replication with strong coordination between servers. Servers coordinate themselves automatically, when they are part of the same replication group. Any server in the group can process updates. Con icts are detected and handled automatically. There is a built-in membership service that keeps the view of the group consistent and available for all servers at any given point in time. Servers can leave and join the group and the view will be updated accordingly. 7 / 60
  • 9. They have a lot in common Similarities 9 / 60
  • 10. Similarities MySQL/MariaDB Replication Method Data centric - All nodes have all data Reads happen on the local node only All require InnoDB/XtraDB as Storage Engine Active-active multi-master Topology Write to multiple nodes No complex/external failover necessary Node membership: join/leave automatically Execute writes in Global Total Order Consistency! Optimistic Locking / First Committer Wins Quorum - split brain prevention 10 / 60
  • 11. Similar - Use Cases Environments with strict durability requirements Write to multiple nodes simultaneously while keeping data consistent Reduce failover time 11 / 60
  • 12. Similar Limitations Large & Long running transactions Higher chance on failures non-e cient replication of large transations Workload hotspots (updating same set of rows in parallel) Often writing to 1 node is the best solution 12 / 60
  • 13. Group Replication vs. Galera Based Differences 13 / 60
  • 14. Differences Group Communication System Binlogs & Gcache Node Provisioniong GTID vs. Seqno Partition Handling Full Solution or Plugin Flow Control WAN Support OS Support Schema Changes 14 / 60
  • 15. Group Communication Galera: Totem Single-ring Ordering All nodes have to ACK message Group Replication: Xcom, similar to Paxos Mencius Paxos only requires majority of nodes to ACK the message in order 15 / 60
  • 16. Binlogs & GCache Galera Cluster/PXC: uses binlog row events but does not require binary logging writes events to Gcache (con gurable size) Group Replication: requires binary logging 16 / 60
  • 17. Node Provisioning Galera Cluster/PXC: has State Snapshot Transfer (SST): Percona XtraBackup (Recommended) rsync mysqldump incremental State Transfer (IST) using GCache MySQL Group Replication: currently no automatic provisioning restoring a backup is required asynchronous replication channel for syncing 17 / 60
  • 18. GTID vs. Seqno MySQL Group Replication: built around MySQL GTID. writes to a cluster create GTID events on the GR Cluster UUID Galera Cluster/PXC: has a seqno which is a incrementing number 18 / 60
  • 19. Partition Handling Galera Cluster/PXC: A partitioned node will refuse reads/writes (con gurable) A partitioned node will automatically recover and rejoin Group Replication: A partitioned node will accept reads A partitioned node will accept write requests, but will hang forever A partitioned node needs to be manually rejoined to the cluster 19 / 60
  • 20. Full Solution or Plugin Plugin: Group Replication is a 'Replication Plugin' several split brain issues in current code Solution: Galera Cluster, handling application connections is not included strong split brain prevention compared to current GR MySQL InnoDB Cluster (w. MySQLRouter) Full Solution: Percona XtraDB Cluster (w. ProxySQL) integrated ProxySQL strict mode prevents limitations from being used 20 / 60
  • 21. Flow Control Prevent a slower node from getting too far behind Galera Cluster/PXC: block all writes in cluster when a node reaches fc_limit ow control message is sent low defaults; Galera: 16(*), PXC: 100 MySQL Group Replication: every node has statistics about every member each individual node decides to throttle writes high default: 25000 21 / 60
  • 22. WAN Support MySQL Group Replication: not recommended for WAN Galera Based Systems have WAN features: Weighted Quorum Tunable network communication settings Reduce network tra c with segments Arbitrator 22 / 60
  • 23. Operating System Support Galera: FreeBSD & Linux Percona XtraDB Cluster: Linux Group Replication: Linux, Windows, Solaris, OSX, FreeBSD 23 / 60
  • 24. Schema Changes - DDL Galera Cluster/PXC: Total Order Isolation: All writes will be blocked during Writes on other nodes will be terminated Workarounds: pt-online-schema-change wsrep_osu_method=RSU More operational work Not for all DDL's Group Replication: DDL does not block all writes, behaves like regular InnoDB 24 / 60
  • 25. Percona XtraDB Cluster vs. Galera Differences 25 / 60
  • 26. Percona XtraDB Cluster vs Galera Cluster PXC has additional features: Extended PFS support SST/XtraBackup Changes Bug-Fixes PXC Strict mode * ProxySQL integration * Performance Enhancements * 26 / 60
  • 27. PXC Strict Mode Prevent experimental/unsupported features: Only Allow InnoDB Operations Prevent Changing binlog_format!=ROW Require Primary Key on tables Disable Unsupported Features: GET_LOCK, LOCK TABLES, CTAS FLUSH TABLES <tables> WITH READ LOCK tx_isolation=SERIALIZABLE 27 / 60
  • 28. ProxySQL Integration PXC includes ProxySQL as load balancer: proxysql-admin con guration tool ProxySQL schedulers : Health Checks Recon gures Nodes PXC Maintenance Mode Tell load balancer to rebalance load 28 / 60
  • 29. Performance Enhancements Several Scalability Fixes in PXC 5.7.17 New Defaults: gcs.fc_limit=100 evs.send_window=10 evs.user_send_window=4 29 / 60
  • 31. Limitations - Galera Cluster/PXC Does not work as expected: InnoDB/XtraDB Only tx_isolation=SERIALIZABLE GET_LOCK() LOCK TABLES SELECT ... FOR UPDATE Careful with ALTER TABLE ... IMPORT/EXPORT. Capped maximum transaction size XA transactions 31 / 60
  • 32. Limitations - Group Replication Does not work as expected: InnoDB/XtraDB Only tx_isolation=SERIALIZABLE GET_LOCK() LOCK TABLES SELECT ... FOR UPDATE Careful with ALTER TABLE ... IMPORT/EXPORT. Careful with large transactions no support for tables with multi-level foreign key dependencies, can create inconsistencies 32 / 60
  • 33. nothing is perfect Known Issues 33 / 60
  • 34. Galera Cluster/PXC - Issues Crashes due to background thread handling trx processing mysql-wsrep#306: stored procedure aborts mysql-wsrep#305: event scheduler mysql-wsrep#304: local scope functions such as CURRENT_USER() Various crashes related to DDL: mysql-wsrep#301: running SHOW CREATE TABLE in multiple nodes with DDL can cause crash. mysql-wsrep#275: Aborting trx leaves behind open tables in cache can cause crash 34 / 60
  • 35. Galera Cluster/PXC - Issues Concurrent DDLs using wsrep_OSU_method=RSU crash/inconsistency issues mysql-wsrep#283 & mysql-wsrep#282 Shutdown issues: mysql-wsrep#303: cleanup during shutdown fails to clear the EXPLICT MDL locks (FTWRL) mysql-wsrep#273: Not getting clean shutting down message if we start the server with unknown variable mysql-wsrep#279: Trying to access stale binlog handler leads to crash 35 / 60
  • 36. Group Replication - Issues Partition Tolerance issues, split brain cannot be prevented: #84727: partitioned nodes still accept writes: queries hang #84728: GR failure at start still starts MySQL #84729: block reads on partitioned nodes #84733: not possible to start with super_read_only=1 (Fixed in 8.0) #84784: Nodes Do Not Reconnect #84795: STOP GROUP_REPLICATION sets super_read_only=off #84574: DDL execute on partitioned node leads to split brain 36 / 60
  • 37. Group Replication Reduce impact on applications: #84731: mysql client connections get stuck during GR start Stability: #84785: Prevent Large Transactions in Group Replication #84792: Member using 100% CPU in idle cluster #84796: GR Member status is wrong 37 / 60
  • 38. Group Replication Usability: #84674: unresolved hostnames block GR from starting (Fixed in 5.7.18) #84794: cannot kill query that is stuck inside GR #84798: Group Replication can use some verbosity in the error log 38 / 60
  • 39. but we try to make it perfect Quality Assurance 39 / 60
  • 40. MySQL Test Suite MySQL Group Replication has an extensive MTR test suite, which covers member join primitives and recovery, member state change, query handling, concurrency, stress etc. Galera as well as Percona XtraDB Cluster uses its own MTR testsuite (not as extensive as mysql group replication) to test recovery, member state change, query handling, concurrency, stress etc. 40 / 60
  • 41. pquery pquery is an open-source (GPLv2 licensed) multi- threaded test program created for stress testing the MySQL server (in any avor), either randomly or sequentially, for QA purposes. To test Group Replication, Percona XtraDB Cluster and Galera we improved our existing pquery cluster framework. This framework will start a 3 node cluster and run pquery against these cluster nodes. 41 / 60
  • 42. pquery pquery is mainly used for "Random Spread Testing" using a rich set of sql statement combinations. We have extracted these SQL statements from the MTR testsuite using a MTR to SQL convertor script (mtr_to_sql.sh) 42 / 60
  • 43. pquery features 20+ Coredumps (crashes/asserts) per hour Fully automatic testcase creation C++ core 120 Seconds per trial run time Thousands of SQL lines executed per trial Compatible with sporadic issues High end automation Ultra fast testcase reduction Full framework 43 / 60
  • 45. Group Replication pquery run resultset $ ~/percona-qa/pquery-results.sh ================ [Run: 466282] Sorted unique issue strings (1000 trials executed, 1557 remaining reducer scripts) head->variables.gtid_next.ty (Seen 16 times: reducers [107-2,3] . is_set (Seen 40 times: reducers [9-1] ... key .= 64U (Seen 1 times: reducers [268-1] ) .length % 4 (Seen 47 times: reducers [7-1] ... m_pos.m_index_1 < mi->rli-> (Seen 3 times: reducers [257-1] .. rem0rec.cc line 867 (Seen 1 times: reducers [515-1] ) .slen % 2 (Seen 24 times: reducers [6-1] ... .slen % 4 (Seen 12 times: reducers [116-1] .. sort_field->length >= length (Seen 5 times: reducers [30-1] ... ..thd (Seen 283 times: reducers [1-1] ... .thd->is_error (Seen 1 times: reducers [393-1] ) thd->lex->sql_command == SQLCOM_XA_COMMIT (Seen 2 times: reducers [576-1] ) thd->mdl_con... (Seen 2 times: reducers [194-1] .. .tlen % 2 (Seen 57 times: reducers [55-1] .. .tlen % 4 (Seen 24 times: reducers [34-1] ... Z10read_tokenPK18sql_digest_storagejPj (Seen 6 times: reducers [173-1] . 45 / 60
  • 46. Group Replication pquery run sample testcase Out of 1000 pquery trials GR crashed 283 times with similar assertion message: handle_fatal_signal (sig=6) in Gtid_table_access_context::init https://bugs.mysql.com/bug.php?id=85364 Generated reduced testcase using reducer.sh DROP DATABASE test; ALTER t t0ADD c c0CHAR exist; XA START 'xid0'; SET @@GLOBAL.binlog_checksum=NONE; 46 / 60
  • 47. Percona XtraDB Cluster pquery run resultset: $ ~/percona-qa/pquery-results.sh ================ [Run: 987219] Sorted unique issue strings (1000 trials executed, 724 remaining reducer scripts) false (Seen 26 times: reducers [60-1,2 get_state (Seen 7 times: reducers [513-3] . is_set (Seen 25 times: reducers [36-1] .length % 4 (Seen 31 times: reducers [23-2] .mdl_context.has_locks (Seen 4 times: reducers [122-2] .thd->is_current_stmt_binlog_format_row (Seen 12 times: reducers [163-1] thd->mdl_context.owns_equal... (Seen 3 times: reducers [4-2] . thd->security_context (Seen 69 times: reducers [45-2,3 .tlen % 2 (Seen 30 times: reducers [21-3] .tlen % 4 (Seen 25 times: reducers [56-2] trx0sys.cc line 354 (Seen 3 times: reducers [617-2] trx0trx.cc line 389 (Seen 41 times: reducers [40-3] ut0ut.cc line 917 (Seen 6 times: reducers [455-3] ZN12ha_myisammrg18append_create_infoEP6String (Seen 230 times: reducers [9-1] . ZN3THD21send_statement_statusEv (Seen 6 times: reducers [697-3] ZN8MDL_lock28has_pendi (Seen 7 times: reducers [519-3] 47 / 60
  • 48. Percona XtraDB Cluster pquery run sample testcase Out of 1000 pquery trials PXC crashed 69 times with similar assertion message: Assertion failed thd->security_context()->user().str https://github.com/codership/mysql- wsrep/issues/304 Reduced testcase Start 2 node cluster Execute following on one of the node "ALTER USER CURRENT_USER() IDENTIFIED BY 'abcd2';" 48 / 60
  • 49. Startup scripts As part of QA testing we have made some handy scripts to start multiple Percona XtraDB Cluster/Galera/Group Replication nodes on the y. These scripts are available in the Percona- QA/percona-qa github project. Currently these scripts supports binary tarball distributions only. 49 / 60
  • 50. PXC/Galera startup script For PXC/Galera run percona-qa/pxc-startup.sh script from the Percona XtraDB Cluster basedir. It will generate a PXC startup script called start_pxc $ git clone https://github.com/Percona-QA/percona-qa $ cd <PXC_BASE> $ ~/percona-qa/pxc-startup.sh Adding script: ./start_pxc ./start_pxc will create ./stop_pxc | ./*node_cli | ./wipe scripts $ ./start_pxc 5 Starting PXC nodes.. $ 50 / 60
  • 51. Group Replication startup script For Group Replication run percona-qa/startup.sh script from Group Replication basedir. It will generate a GR startup script called start_group_replication $ cd <MySQL BASE> $ ~/percona-qa/startup.sh Adding scripts: start | start_group_replication | start_valgrind | start_gypsy | stop | kill | setup | cl | test | init | wipe | all | prepare | run | measure | tokutek_init Setting up server with default directories [..] $ 51 / 60
  • 52. Group Replication startup script $ ./start_group_replication 3 Starting 3 node Group Replication, please wait... Started node1. Started node2. Started node3. Added scripts: | 1cl | 2cl | 3cl | wipe_group_replication | stop_group_replication Started 3 Node Group Replication. [..] $ 52 / 60
  • 54. Performance Tests Performance comparison between Percona XtraDB Cluster, Galera and Group Replication. Workload : Sysbench OLTP_RW, UPDATE_KEY and UPDATE_NOKEY Table count : 100 (4 millions rows each) Data Size : 100GB Cluster : 3 Node https://www.percona.com/blog/2017/04/19/performance- improvements-percona-xtradb-cluster-5-7-17/ 54 / 60
  • 55. Performance Tests Sysbench OLTP_RW, UPDATE_KEY and UPDATE_NOKEY workloads with 100 tables (sync_binlog=1) 55 / 60
  • 56. Performance Tests Sysbench OLTP_RW, UPDATE_KEY and UPDATE_NOKEY workloads with 100 tables (sync_binlog=0) 56 / 60
  • 57. Performance Tests Cluster node joining speed performance. Testcase Shutdown one node from 3 node cluster Sysbench run (create single table) Start the node which was o ine. Check node status With PXC script will check wsrep_local_state_comment status With Group Replication script will check replication group ONLINE status. 57 / 60
  • 58. Performance Tests Cluster node joining speed performance graph. (smaller is better) 58 / 60
  • 59. Summary Galera PXC GR/MIC Automatic Node Provisioning ✓ ✓ Load Balancer Integration ✓ ✓ Enforcing Best Practices ✓ ✓ Partition Handling ✓ ✓ Mature Technology ✓ ✓ Multi-Master ✓ ✓ ✓ WAN Support ✓ ✓ OS Support ✓ ✓ ✓ Performance ✓ ✓ Supported By Percona ✓ ✓ ✓ 59 / 60
  • 60. Ramesh Sivaraman Kenny Gryp just a few Questions? 60 / 60