以下文章来源于爱可生开源社区 ,作者雍正喵
3.20.07.0 版本
DBLE Release Notes
https://github.com/actiontech/dble
一、DBLE 项目介绍
破壳日:2017.10.24
爱好:开源
技能:数据水平拆分、读写分离、分布式事务支持、多分片算法、全局 ID、IP/SQL 黑白名单
特长:MySQL 语法兼容、复杂查询优化、低改造成本、成熟稳定、成熟技术栈
DBLE 官方项目:
DBLE 官方文档(已更新):
https://actiontech.github.io/dble-docs-cn
二、新版本主要更新解读
新版 DBLE 新增重构功能 6 个,修复缺陷 16 个,向后兼容性调整 1 处;
致谢:
主要更新:
可以通过升级工具 dble_update_config 将配置从 2.20.04.0 升级到 3.20.07.0,如果是更早版本,建议先升级到 2.20.04.0。
升级工具用法:
dble_update_config [-i=read_dir] [-o=write_dir] [-p=rootPath]
read_dir/write_dir:ruguo 不指定,缺省值为当前目录,建议指定或者提前备份配置 rootPath:如果集群模式是 zk,那么缺省值为 /dble,如果集群模式是 ucore,缺省值为 universe/dble。
myid.properties
wrapper.conf
server.xml
schema.xml
rule.xml
log4j2.xml
cacheservice.properties(option)
sequence_distributed_conf.properties for type3 (option)
sequence_time_conf.properties for type2 (option)
bootstrap.cnf
user.xml
db.xml
sharding.xml
log4j2.xml
cacheservice.properties(option)
非拆分表的以下四种 DML 语句支持直接下推到 MySQL:
INSERT ... SELECT
DELETE... 多表关联
UPDATE... 多表关联
另外,拆分规则相同的表格也会支持 INSERT ... SELECT 等语句
在 3.20.04.0 或之前版本的 DBLE 中执行 DDL,需要加表锁,若是在集群中,也会通知其他 DDL 加上表锁,加锁期间执行对应表的 SQL 会报错。在 DDL 执行结束后,DBLE 会下发 show create table 得到建表语句,得到建表语句后会解析重新生成元数据,集群中的其他 DBLE 也会执行此操作。
但一部分 SQL 其实对 dble 不造成影响,对 dble 造不造成影响的判断依据在于是否需要更改 dble 中表的元数据,目前 dble 中表的元数据只关心表的列名称,列类型,类是否为 null。若这样的 sql 在 mysql 侧也是 onlineDDL 的,可以无需加锁,直接下发执行,例如增加索引的操作。
以下列举了 MySQL 8.0 中所有的 ONLINE DDL 以及是否在 DBLE 中支持 ONLINE DDL 模式。
Index Operations
Primary Key Operations
Column Operations
Generated Column Operations
Foreign Key Operations
Table Operations
Tablespace Operations
Partitioning Operations
详细模式介绍请参考文末【参考 3】
三、更新日志(Release Notes)
特性:
[#1879] 重构连接池的代码
[#1863] 支持更多 DML 语句可以被直接将其下推到 MySQL。更多详细信息请参见文末【参考 1】
[#1849] 重构配置文件:DBLE 的配置文件有很大变化,更多详细信息请参见文末【参考 2】。如果要将旧的配置(必须为2.20.04.x)升级到新的配置,则可以使用名为“ dble_update_config”的工具。
[#1848] 支持在线 DDL。更多详细信息请参见文末【参考 3】
[#1846] 通过 WriteToBackendExecutor 在复杂查询中发送查询
[#1906] DBLE 支持 OGG 工具进行数据同步(alpha 功能)
缺陷修复:
[#2030] 执行一个复杂的 SQL,其中包含许多并集但会挂起
[#2029] 当列名称包含中文时,发生错误“field not found:c.成功一”
[#2025] 错误,当 select
中存在常量时
[#2022] Round
函数有问题
[#2021] 多个联合和子查询后,列顺序不正确
[#1977] 不支持管理命令时,需要在日志中打印查询
[#1939] 启用 PreparedStatement 后,将对包含 blob,text 等数据类型的表进行多次插入操作;插入的值包含先前 SQL 插入/更新的值。
[#1926] 如果分片值是十六进制类型,DBLE 将报告错误或路由到错误的节点
[#1913] 当两个 sharding_table inner join 时,查询 DATEDIFF() 结果不同于单表查询 DATEDIFF()
[#1820] JDBC 在通过 setblob
或 setBinaryStream
保存图片时遇到了问题,这要感谢 @z3093964447 报告此错误。
[#1814] 当“load data”失败时,临时文件未被删除
[#1788] 前端连接超时,可能导致心跳检测失败
[#1760] 在 XA 事务中执行 DDL 时污染了 MySQL 连接池
[#1701] 期望默认的 XA 日志名称和 XA 日志直接名称包含“ xa”
[#1678] show tables 的结果集列名与 MySQL 不符
[#1658] 当 tempReadHostAvailable ="1",
show slave status
无法正常切换,这要感谢 @dairight 报告了该错误
打破向后兼容性:
[#1849] 重构配置文件:DBLE 的配置文件有很大变化,更多详细信息请参见文末【参考 4】。如果要将旧的配置(必须为2.20.04.x)升级到新的配置,则可以使用名为“ dble_update_config”的工具。
Features:
[#1879] Refactor code for connection pool
[#1863] Support more DML queries which can be pushed down to MySQL directly. More Detail,see 3.SQL_Syntax/3.2_DML
[#1849] Refactor config files:There are big changes for config files of dble, More Detail,see 1.00_config_file . If you want to upgrade your old configs(must be 2.20.04.x) to new configs, you can use the tool named dble_update_config
. .
[#1848] Support online ddl. More Detail,see online_ddl
[#1846] send query by WriteToBackendExecutor in complex query
[#1906] Supports the tool OGG
for data synchronization (alpha)
Bug-fixes:
[#2030] Execute a complex SQL which contains many unions but hang
[#2029] Occur error"field not found:c.成功一" when the column name contains Chinese
[#2025] Error when there is constant in select
[#2022] Round
function have problem
[#2021] After multiple unions and subqueries, the column order is incorrect
[#1977] The query needs to be printed in the log,when management commands not supported
[#1939] When PreparedStatement is enabled, multiple insert operations on tables containing data types such as blob、text; the inserted value contains the value of the previous SQL insert/update.
[#1926] If sharding value is a hex type,dble will report error or route to the wrong node
[#1913] When two sharding_table inner join , the select DATEDIFF() result is different from one table select DATEDIFF()
[#1820] JDBC has problems saving pictures via setblob or setBinaryStream , thanks to @z3093964447 for reporting the bug.
[#1814] When load data
failed,the file:temp was left behind
[#1788] Front connect timeout,may cause heartbeat detection to fail
[#1760] Contaminate mysql connection pool when doing ddl in xa transaction
[#1701] Expect the default xa log name and xa log directoty name contain 'xa'
[#1678] Column name of [show tables] resultset is not consistent with mysql
[#1658] When tempReadHostAvailable="1",
show slave status
not work, thanks to @dairight for reporting the bug.
Breaking backward compatibility:
[#1849] Refactor config files:There are big changes for config files of dble, More Detail,see 1.00_config_file . If you want to upguard your old configs(must be 2.20.04.x) to new configs by tool.
本次的发版报道就到这里啦~
参考链接:
【参考 1】3.SQL_Syntax / 3.2_DML
https://github.com/actiontech/dble-docs-cn/tree/develop/3.SQL_Syntax/3.2_DML
【参考 2】1.00_config_file
https://github.com/actiontech/dble-docs-cn/blob/develop/1.config_file/1.00_config_file.md
【参考 3】3.1.6 ONLINE DDL
https://github.com/actiontech/dble-docs-cn/blob/develop/3.SQL_Syntax/3.1_DDL/3.1.6_DDL%26online_ddl.md
【参考 4】1.00_config_file
https://github.com/actiontech/dble-docs-cn/blob/develop/1.config_file/1.00_config_file.md