知识卡片
并发副本扣库存会算错余额
原书库存教学例:A、B 两个可写缓存副本都从 500 件开始。A 卖 10 件写成 490;A 的更新尚未复制到 B 时,B 卖 5 件写成 495。随后两份更新交叉覆盖,B 变成 490、A 变成 495,而正确库存是 485。根因是同一库存键在复制延迟窗口内被两个副本独立改写;各自的“读取旧值再扣减”不能合并成总扣减。见 [[集中缓存缩小库存副本冲突]]。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Space-Based Architecture Style · 查看原书依据
Both caches are incorrect and out of sync: the inventory should be 485 units in each of the instances.
参考来源
- 位置:《Fundamentals of Software Architecture》原书第16章《Space-Based Architecture Style》(阅读计划第19项,单元19;源文件:`OEBPS/ch16.html`)
- 结论依据:原书逐步列出两实例各自扣减库存、复制交叉覆盖及正确库存485的教学场景;没有报告真实系统事故。
- 原始内容:Both caches are incorrect and out of sync: the inventory should be 485 units in each of the instances.