Replies: 3 comments 1 reply
-
|
timestamp 字段类型调整为 datetime |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
部署多个 Arana 节点的定时任务,考虑任务互斥情况 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
核心流程
1、正常流程:用户提交事务流程如下:

2、正常流程:用户回滚事务流程如下:

3、异常流程:事务处于中间状态

如果 Arana 和 DB 通信中断,导致无法通知 DB 侧将事务及时回滚/提交,使事务一直处于中间状态,需要 Arana 对这些事务手动进行处理。Arana 中有一个 “Agent”定时任务,会定期扫描所有中间状态的事务,进行处理。
4、死锁检测
// TODO
细节设计
1、Arana 全局事务表 __arana_global_trx_log:
2、Arana 分支事务表 __arana_branch_trx_log:
3、Arana 的 Agent 本质上是一个定时任务,会定期扫描 __arana_global_trx_log 表,查找 expected_end_time 超时,并且处于非“committed”或“rollbacked”状态的全局事务,主动触发分支事务(非“committed”、“rollbacked”或“failed”)进行结束。
4、注意,__arana_global_trx_log 表和 __arana_branch_trx_log 表是属于 Arana 的系统表。
参考资料
[1] 这才是真正的分布式事务 XA 详解
https://juejin.cn/post/7096781044010991629
[2] 分布式系统事务处理:二阶段提交与三阶段提交协议解析
https://baijiahao.baidu.com/s?id=1781249550136480595&wfr=spider&for=pc
[3] 6 张图带你彻底搞懂分布式事务 XA 模式
https://developer.aliyun.com/article/783796
[4] 腾讯云TDSQL——分布式事务实现机制
https://www.modb.pro/db/109733
[5] Mysql的分布式(XA)真面目
https://blog.csdn.net/u013487071/article/details/123718874
[6] TDSQL在分布式事务阶段遇到死锁时如何处理的
https://www.cnblogs.com/tencentdb/p/15220582.html
[7] 13.3.8 XA事务
https://zhuanlan.zhihu.com/p/400930855
[8] MySQL · 特性分析 · 浅谈 MySQL 5.7 XA 事务改进
http://mysql.taobao.org/monthly/2017/09/05/
Beta Was this translation helpful? Give feedback.
All reactions