Galera Cluster New Features

Mariadb 10.4将附带新的Galera复制版本4。本演示文稿将概述Mariadb 10.4中提供的Galera 4复制的新功能,并分享早期的用户体验。
Galera是一个通用的复制插件,使其能够与支持Galera复制插件API(即写集复制、wsrep API)的数据库服务器部署同步多主集群拓扑。目前,mysql和mariadb服务器都支持galera复制,现在,在世界各地,有数千个基于mysql和mariadb的集群安装,在裸机或云部署中处理生产系统负载。
通过galera 4,mariadb 10.4集群进一步扩展了同步galera复制的能力。Galera4版本最突出的特点是流式复制技术,它在集群内实现分布式事务处理。通过流式复制,可以启动事务以在所有集群节点中并行执行。这样,在事务生命周期之外,可以以小片段执行大型事务,并且集群不会像在早期的Galera集群版本中那样,被一个大型事务写入集的复制阻塞。
流式复制是许多其他特性的基础,将在短期内发布。例如,由于流复制技术,XA事务支持现在将成为可能。

展开查看详情

1. Galera 4 in MariaDB 10.4 And a little bit in MySQL Seppo Jaakola Codership 1

2. CEO Codership Developer role, 15 yrs with MySQL engineering Background: DBMS Engineering Data Security Seppo Jaakola www.galeracluster.com

3. CCooddeer rsshhi ipp Technology Company Since 2007 Technology Company, focus in R&D Replication for Open Source Since 2007 Databases Replication for Open Source Databases Galera Cluster Galera Cluster Business through MySQL / MariaDBthrough Business SupportMySQL & Consulting / MariaDB Support & Consulting Stable continuous growth, team growing 3 → ~20

4. Agenda ● Galera Cluster Overview ● Galera 4 in 10.4 Features ● Upgrading 10.3 Cluster to 10.4 ● Galera 4 Streaming Replication ● Additional Galera 4 Feature Road Map www.galeracluster.com 4

5. Galera Replication ● Generic Replication Plugin for database servers ● Uses Replication API to interact with DBMS (wsrep API project in github) galera ● DBMS and Galera plugin must have same wsrep API version www.galeracluster.com

6. Galera Replication Versions ● Major versions 1..2..3 ● Current production head version 3.26 ● wsrep API versions 1..25 ● Next major version is Galera 4 and using wsrep API #26 ● wsrep API change requires rolling upgrade path www.galeracluster.com 6

7.Galera in MariaDB 10.4 7

8. Galera 4 in MariaDB 10.4 ● MariaDB 10.4 RC has Galera 4 Replication ● wsrep API #26 ● Impacts upgrading ● wsrep patch integration in 10.4 codebase ● Impacts code stability ● bug fix & new features turnover www.galeracluster.com 8

9. Galera 4 in MariaDB 10.4 ● Streaming Replication ● Support for large transactions ● Platform for other new features ● Group commit support ● 10.4 Backup locks ● mariabackup SST with “light weight lock” www.galeracluster.com 9

10.Streaming Replication 10

11. Streaming Replication ● Originally developed for supporting huge transactions ● In Galera 3, transaction processes in master node until commit time ● For large transactions, the write size will be big, and is hard to handle ● There are means to prevent too large transactions ● wsrep_max_ws_size www.galeracluster.com 11

12. Streaming Replication ● Streaming replication is new technology developed for Galera Replication 4 to enable running transaction of unlimited size in cluster ● Transaction size limits will remain, and cluster can still reject too large transactions www.galeracluster.com 12

13. Streaming Replication ● Transaction is replicated, gradually in small fragments, during transaction processing ● i.e. before actual commit, we replicate a number of small size fragments ● Size threshold for fragment replication is configurable ● Replicated fragments are applied in slave threads preserving transaction’s state in all cluster nodes ● Fragments hold locks in all nodes and cannot be conflicted later www.galeracluster.com 13

14. Streaming Replication Huge transaction Begin Update, update, update.... Node A Node B Trx Galera Replication www.galeracluster.com 14

15. Streaming Replication Huge transaction Update, update, update.... Node A Node B Trx SR Trx WS Galera Replication www.galeracluster.com 15

16. Streaming Replication Huge transaction Update, update, update.... Node A Node B Trx SR Trx WS Galera Replication www.galeracluster.com 16

17. Streaming Replication Huge transaction commit Node A Node B Trx SR Trx WS C Galera Replication www.galeracluster.com 17

18. Streaming Replication Huge transaction OK Node A Node B Galera Replication www.galeracluster.com 18

19. Fragment Applying SR transaction pool applier SR#1 THD SR#2 THD applier apply applier SR#n THD WS certification SR trx :2 CF: 0 www.galeracluster.com 19

20. Fragment Applying SR transaction pool applier SR#1 THD SR#2 THD applier apply Pull THD applier SR#n THD WS certification SR trx :2 CF: 0 www.galeracluster.com 20

21. Fragment Applying SR transaction pool applier SR#1 THD applier apply ev→apply_event() SR#n THD WS SR#2 THD … applier SR trx :2 ev->apply_event() CF: 0 wsrep_SR_store->append_frag_apply()) WS SR trx :2 CF: 0 www.galeracluster.com 21

22. Fragment Applying SR transaction pool applier SR#1 THD Push THD SR#2 THD applier applier SR#n THD OK WS SR trx :2 CF: 0 www.galeracluster.com 22

23. Fragment Committing SR transaction pool applier SR#1 THD commit Pull THD SR#2 THD applier applier SR#n THD WS certification SR trx :2 CF: 1 www.galeracluster.com 23

24. Fragment Committing SR transaction pool applier SR#1 THD trans_commit() commit wsrep_SR_store->append_frag_commit()) WS applier SR trx :2 SR#2 THD CF: 1 SR#n THD applier WS SR trx :2 CF: 1 www.galeracluster.com 24

25. Fragment Committing SR transaction pool applier SR#1 THD applier applier SR#1nTHD OK WS SR trx :2 CF: 1 www.galeracluster.com 25

26. Configuring Streaming Replication wsrep_trx_fragment_unit Unit metrics for fragmenting, options are: ● bytes WS size in bytes ● rows # of rows modified ● statements # of SQL statements issued wsrep_trx_fragment_size ● Threshold size (in units), when fragment will be replicated ● 0 = no streaming Session variables and can be dynamically set www.galeracluster.com 26

27. Using Streaming Replication ● Due to excessive logging and elevated replication overhead, streaming replication will cause degraded transaction throughput rate ● Best use case is to use streaming replication for cutting large transactions ● Set fragment size to ~10K rows ● Fragment variables are session variables and can be dynamically set ● Intelligent application can set streaming replication on/off on need basis www.galeracluster.com 27

28.New Meta Data 28

29. wsrep Tables in mysql database MariaDB [(none)]> show tables in mysql like 'wsrep%'; +--------------------------+ | Tables_in_mysql (wsrep%) | +--------------------------+ | wsrep_cluster | | wsrep_cluster_members | | wsrep_streaming_log | +--------------------------+ 3 rows in set (0.005 sec) www.galeracluster.com 29