![Page 1: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/1.jpg)
Jay Janssen Lead Consultant
February 5th, 2014
What’s new in Percona Xtradb Cluster 5.6
![Page 2: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/2.jpg)
www.percona.com
Overview
PXC 5.6 is the aggregation of Percona Server 5.6 Codership MySQL 5.6 patches Galera 3.x
Agenda Major new features Async replication and PXC 5.6 5.6 features that play nicely (or not) with Galera Future features Questions
![Page 3: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/3.jpg)
www.percona.com
What is Percona XtraDB Cluster?
Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node state PXC product 2 years in GA with 5.5, 13 releases
total, over 150k downloads Lots of development effort in the test suite Easy to migrate from and integrated with MySQL
async replication
![Page 4: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/4.jpg)
Galera Replication Enhancements
![Page 5: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/5.jpg)
www.percona.com
Replication overhead for Keys
Keys track all Schemas, Tables, and PK/UKs/FKs of rows being modified in the writeset
250k row inserts ala sysbench prepare
Rep
licat
ed M
Byte
s
0
12.5
25
37.5
50
Galera 2 Galera 3
1.915.2545.2545.25
RBRKeys
![Page 6: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/6.jpg)
www.percona.com
Keys are now hashed
Hashed keys reduces writeset sizes Especially for large key columns !
Single INSERT writeset size
Byte
s
0
100
200
300
400
G2 INT G2 CHAR(128) G3 FLAT8 G3 FLAT16
7147
174
58223223223223 RBR
Keys
![Page 7: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/7.jpg)
www.percona.com
Improved Memory usage (certification index)
mysqld RSS
Kill
obyt
es
0
175,000
350,000
525,000
700,000
wsrep_provider=none Galera 2 Galera 3
384,252
646,444
170,664 198,428197,460168,684
Startup ((innodb_buffer_pool_populate=ON) After Large Trx
![Page 8: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/8.jpg)
www.percona.com
Overall improvements
Writesets have a new format faster certification less memory checksums Writeset keys stored as hashes FLAT8/FLAT16 Socket Checksums CRC32-C (hw accel where supported)
![Page 9: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/9.jpg)
WAN Segments
![Page 10: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/10.jpg)
www.percona.com
Multiple Datacenter Cluster
Datacenter 1
Datacenter 2
Datacenter 3
![Page 11: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/11.jpg)
www.percona.com
Replication without Segments
Datacenter 1
Datacenter 2
Datacenter 3
Client commits here
![Page 12: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/12.jpg)
www.percona.com
Cluster segments
Set gmcast.segment distinct per-location All nodes in colo1 have gmcast.segment=1 All nodes in colo2 have gmcast.segment=2 etc. Benefits Replication traffic is minimized between segments Donor selection prefers local segment
![Page 13: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/13.jpg)
www.percona.com
Replication with Segments
Datacenter 1
Datacenter 2
Datacenter 3
Client commits here
gmcast.segment=2
gmcast.segment=1
gmcast.segment=3
![Page 14: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/14.jpg)
www.percona.com
Donor Selection with Segments
Datacenter 1
Datacenter 2
Datacenter 3
gmcast.segment=2
gmcast.segment=1
gmcast.segment=3
Joiner
prefers local nodes
![Page 15: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/15.jpg)
Asynchronous Replication into the cluster
![Page 16: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/16.jpg)
www.percona.com
Any node can be a slave
node1
node3 node2
async master
![Page 17: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/17.jpg)
www.percona.com
Galera 2 behavior
async
begin
apply
commit request
replicate
certify
commit finalized
slave node
begin
apply
certify
commit finalized
node2
begin
apply
certify
commit finalized
node3cy
cle
per r
eplic
ated
tran
sact
ion
Galera <= 2.x or wsrep_preordered=OFF
![Page 18: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/18.jpg)
www.percona.com
Galera 3 with wsrep_preordered=ON
async
replicate
certify*
commit finalized
slave node
begin
apply
certify*
commit finalized
node2
begin
apply
certify*
commit finalized
node3
cycl
e pe
r rep
licat
ed tr
ansa
ctio
n
Galera 3+ and wsrep_preordered=ON
begin
apply
![Page 19: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/19.jpg)
www.percona.com
When to use wsrep_preordered
wsrep_preordered=ON Better performance Does not allow for conflicts with any other writes No parallel apply for these transactions Good for Master / Slave to Cluster migration wsrep_preordered=OFF Detects conflicts with any other writes Allows parallel apply Good for permanent Cluster-is-a-slave
![Page 20: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/20.jpg)
Asynchronous Replication out of the cluster
![Page 21: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/21.jpg)
www.percona.com
5.6 async GTID integration
Every node with log-bin will have the same GTID for the same transaction
node1
node3 node2
async slave
node1
failed node2
async slave
CHANGE MASTER TO MASTER_HOST='node2',
MASTER_AUTO_POSITION=1
![Page 22: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/22.jpg)
General 5.6 Improvements
![Page 23: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/23.jpg)
www.percona.com
Can I use <5.6 feature> in PXC?
Every new feature works fine within a single node E.g., Innodb Full Text Indexes, Partitioning,
Optimizer enhancements, Performance Schema, etc.
Don’t expect automatic “cluster” support E.g., Online DDL improvements memcached server https://bugs.launchpad.net/percona-xtradb-
cluster/+bug/1254126
![Page 24: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/24.jpg)
www.percona.com
Minimal RBR images
Pre-5.6 RBR is full row images for any row change 5.6 adds binlog_row_image=minimal (not default) Seems fine with PXC RBR image is black-box to Galera 1 Minute Sysbench Update Test (1 col out of 3 modified)
MB
Rep
licat
ed
0
17.5
35
52.5
70
full minimal
13.4
62.3
![Page 25: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/25.jpg)
Upgrading a 5.5 cluster to 5.6
![Page 26: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/26.jpg)
www.percona.com
The easy way
Take the downtime and upgrade it all at once Check for my.cnf settings that are not 5.6
compatible Start each node with “wsrep_provider=none” Run mysql_upgrade Shutdown again Bootstrap normally
![Page 27: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/27.jpg)
www.percona.com
Rolling upgrade
RBR 5.6 -> 5.5 replication is broken For each 5.6 upgraded node Compatibility options with 5.5 must be set Galera socket.checksum=1 Don’t SST 5.5 to 5.6! Don’t write on these nodes! Before last node, flip application to 5.6 nodes Take down remaining 5.5 node(s) for upgrade Rolling restart to remove 5.5 compat options http://bit.ly/pxc56-rolling-upgrade
![Page 28: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/28.jpg)
Odds and Ends
![Page 29: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/29.jpg)
www.percona.com
My Favorite Bug Fixes
Adding auto_increment column to existing table doesn’t cause inconsistency with auto_increment_control
wsrep_local_bf_aborts catches all BF aborts now wsrep_flow_control_sent/received now global
counters wsrep_max_ws_size/ws_rows moving towards
being properly enforced now*
![Page 30: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/30.jpg)
www.percona.com
Future Features
Automatic huge transaction fragmentation/streaming support
Non-blocking DDL support Cluster tolerance to inconsistencies Intelligent inconsistency handling (e.g., node voting) Intelligent donor selection (e.g., check gcache) Performance optimizations (i.e., multi-core) Multiple provider support
![Page 31: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/31.jpg)
Questions?
![Page 32: What's new in PXC 5s ne… · Read and Write anywhere Innodb cluster Highly available quorum-based failover Synchronous replication for data consistency Cluster responsible for node](https://reader033.vdocument.in/reader033/viewer/2022052015/602cd3023897481cba4bbdbd/html5/thumbnails/32.jpg)
Advanced Rates End March 2nd at 11:30pm PST, 2014 !
Special Discount for Webinar Attendees: Use Code WebinarSC to receive 10% off of standard
rates (new registrations only) !
http://www.percona.com/live/mysql-conference-2014/
!!!