知识卡片
补偿不能收回已传播副作用
工单先提交完成并发送分析消息,随后调查失败触发补偿,把工单改回处理中。但分析服务可能已经消费“完成”数据并触发更多下游动作,反写工单无法撤回这些副作用。根因是跨服务Saga不具备数据库事务的隔离性,其他服务可在整体工作流结束前观察局部提交。纠正分析数据还需额外消息、时序判断及下游修复,不能把补偿称为无条件回滚。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 事务Saga · 查看原书依据
We call this a side effect within distributed architectures. By reversing the transaction in the Ticket Service, actions performed by other services using data from the prior update may have already taken place and might not be able to be reversed. This scenario points to the importance of isolation within a transaction, something that distributed transactions do not support.
参考来源
- 位置:《Software Architecture The Hard Parts Modern Trade-Off Analyses for Distributed Architectures (Neal Ford, Mark Richards, Pramod Sadalage etc.)》第12章《Chapter 12. Transactional Sagas》(来源项目:book-sources;源文件:extracted/Software Architecture The Hard Parts Modern Trade-Off Analyses for Distributed Architectures (Neal Ford, Mark Richards, Pramod Sadalage etc.)/_epub-src/OEBPS/ch12.xhtml)
- 结论依据:原文的定义、示例或失败路径支持以下归纳:工单先提交完成并发送分析消息,随后调查失败触发补偿,把工单改回处理中。 其他条件结合本章同小节说明;不将模式目标当成已有运行保证。
- 原始内容:We call this a side effect within distributed architectures. By reversing the transaction in the Ticket Service, actions performed by other services using data from the prior update may have already taken place and might not be able to be reversed. This scenario points to the importance of isolation within a transaction, something that distributed transactions do not support.