知识卡片

支付系统案例卡 · 10294.a.4.a.2.d · 生成模型:未记录

转账部分生效破坏原子性

理解等级:中级

账户借记与另一账户贷记可由不同分片执行,每边的读旧余额、计算和保存又包含多个步骤。若只完成一边就失败,而结果已对外生效,账务会处于单边变更状态。单个分片局部操作成功无法说明整笔交易结束。

参见 [[跨分片转账统一提交]]。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Database Internals》Chapter 13. Distributed Transactions(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch13.html#database_transactions,段 6) - 结论依据:原文以转账拆解为单边余额多步读改写,紧接着说明部分执行必须可回滚。 - 原始内容:Generally speaking, when transferring money from one account to another, you’d like to both credit the first account and debit the second one simultaneously. However, if we break down the transaction into individual steps, even debiting or crediting doesn’t look atomic at first sight: we need to read