知识卡片
未知状态不能当作不存在
照片清理器按用户不存在删除照片时,如果上游将数据库不可用映射成404,就会把查询失败误当作所有账户已删除,造成级联误删。应区分确定不存在与当前无法确认;破坏性消费者还需限速、异常数量熔断和恢复路径,防止单处错误扩散成全局不可逆动作。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 16. Common Failure Patterns · 查看原书依据
Suppose the person who coded that piece of logic chooses to return a 404 indicating that the user couldn’t be found. “Not Found” is perhaps not the best error to return in this case—500 internal service error is definitely better; but it is hard to see how this
参考来源
- 位置:《Designing Distributed Systems, 2nd Edition》第16章《Chapter 16. Common Failure Patterns》(来源项目 book-sources;源文件:extracted/Designing Distributed Systems, 2nd Edition/_epub-src/OEBPS/ch16.html)
- 结论依据:原文用户查找404与垃圾回收交互,随后提出删除限速和熔断。
- 原始内容:Suppose the person who coded that piece of logic chooses to return a 404 indicating that the user couldn’t be found. “Not Found” is perhaps not the best error to return in this case—500 internal service error is definitely better; but it is hard to see how this