您的位置:首页 > 博客中心 > 数据库 >

Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication

时间:2022-03-16 11:49

Overview

Galera Cluster

  • 由 Coder<!---->ship 开发
  • 包含在MariaDB,在Percona、MySQL 都可以使用

Galera Cluster 是一个基于 InnoDB 多主的同步复制,可以读写任何节点,即使失去任何一个节点也不影响业务中断,而且无需复杂的 failover 操作。

Percona XtraDB Cluster

  • 由 Percona 开发,在 Galera 基础打 Patch
  • 自 2012 年 4 月可用
  • 附加的特性
    • PFS 扩展支持
    • SST/XtraBackup 方式的改变
    • PXC Strict mode *
    • ProxySQL 集成 *
    • 提升性能 *

MySQL Group Replication

  • 由 Oracle 官方开发
  • 2016 年 12 月 MySQL 5.7.17 发布 GA
  • MySQL InnoDB Cluster 整体解决方案

MySQL Group Replication 是一个 MySQL Server Plugin,提供分布式状态机复制与 Server 强大协调,当在一个 Group Replication 时,Server 将自动协调,每个节点都可以自动处理更新,自动检测,有一个 membership service 维护一个 view,记录组内 记录可见成员在某个时间点一致性和高可用性的,当任何一个成加入或离开,view 就会相应的更新

MySQL InnoDB Cluster

技术图片

Limitations

  • Galera Cluster/PXC

    • 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
  • Group Replication

    • InnoDB/XtraDB Only
    • tx_isolation=SERIALIZABLE
    • GET_LOCK()
    • LOCK TABLES
    • SELECT ... FOR UPDATE
    • CarefulwithALTER TABLE ... IMPORT/EXPORT.
    • Careful with large transactions
    • no support for tables with multi-level foreign key dependencies, can create inconsistencies

Known Issues

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:runningSHOW CREATE TABLE in multiple nodes with DDL can cause crash.
    • mysql-wsrep#275: Aborting trx leaves behind open tables in cache can cause crash
  • 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

Group Replication Issues

分区容忍问题,不能防止脑裂

* #84727: partitioned nodes still accept writes: queries hang (~Fixed in 5.7.20)
* #84728: GR failure at start still starts MySQL (~Fixed in 8.0.2)
* #84729: block reads on partitioned nodes
* #84733: not possible to start with super_read_only=1 (Fixed in 8.0.2)
* #84784: Nodes Do Not Reconnect
* #84795: STOP GROUP_REPLICATION sets super_read_only=off

减少冲突

* #84731: mysql client connections get stuck during GR start

稳定性

* #84785: Prevent Large Transactions in Group Replication (~Fixed in 5.7.19)
* #84792: Member using 100% CPU in idle cluster (*)
* #84796: GR Member status is wrong

可用性

* #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

Q & A

这个看原 PDF 吧。

Performance Tests

技术图片

原文:  


本类排行

今日推荐

热门手游