知识卡片
按消息身份去重扣款
保留首次操作的消息身份,在重传时沿用。接收端按该身份判断操作是否已处理,跳过已处理的重复消息。幂等操作多次执行不会增加副作用,对于扣款这样的非幂等操作,去重可在保持操作含义的同时达到与幂等相近的保证。
参见 [[扣款确认丢失导致重扣]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 8. Introduction and Overview Message retransmits · 查看原书依据
Idempotence is particularly important in the presence of partial failures and network partitions, since we cannot always find out the exact status of a remote operation—whether it has succeeded, failed, or will be executed shortly—and we just have to
参考来源
- 位置:《Database Internals》Chapter 8. Introduction and Overview(book-source:extracted/Database Internals A deep-dive into how distributed data systems work (Alex Petrov)/_epub-src/OEBPS/ch08.html#idm46104530993736,段 128)
- 结论依据:原文为不可能要求所有操作天然幂等的场景提出按消息去重。
- 原始内容:Idempotence is particularly important in the presence of partial failures and network partitions, since we cannot always find out the exact status of a remote operation—whether it has succeeded, failed, or will be executed shortly—and we just have to