论文:Harvest, Yield, and Scalable Tolerant Systems
本篇整理 Armando Fox 与 Eric A. Brewer 的《Harvest, Yield, and Scalable Tolerant Systems》。正文按 HotOS-VII(1999)版本逐页翻译;每一页保留原始 PDF 页面图,harvest、yield、CAP、graceful degradation、fault isolation、orthogonal mechanism、soft state 等术语按分布式系统领域惯例保留 English 或中英并列。
论文:Harvest, Yield, and Scalable Tolerant Systems
相关文章:论文:Spanner:Google’s Globally-Distributed Database · 论文:Dynamo:Amazon’s Highly Available Key-value Store · 论文:Chain Replication for Supporting High Throughput and Availability · 论文:Consensus in the Presence of Partial Synchrony · 论文:The Weakest Failure Detector for Solving Consensus
TL;DR
- 核心问题:Internet-scale application 同时追求 consistency、state management 和 high availability 时,partial failure 与规模会让系统复杂度迅速增长。
- 两个指标:
yield是请求成功完成的概率;harvest是 response 中反映了多少应有数据,即结果的 completeness。 - 第一条策略:允许以降低 harvest 换取 yield,通过 probabilistic availability、随机数据放置、优先数据 replication 和 graceful degradation,让服务尽量持续返回结果。
- 第二条策略:把 application 分解为相互独立的 subsystems,并用 orthogonal mechanisms 提供 replication、timeouts、retries、sandboxing、soft-state repair 等能力,让部分 subsystem failure 不拖垮整体服务。
- 与 CAP 的关系:论文把经典 strong CAP 推广为更现实的 Weak CAP:对 consistency、availability、partition resilience 中任意两项的 guarantee 越强,第三项能提供的 guarantee 就越弱。
名词解释
| 名词 | 含义 | 本文对应物 |
|---|---|---|
| harvest | response 中包含的正确/完整数据比例 | completeness of query answer |
| yield | 请求最终完成的概率 | availability 的常见指标 |
| graceful degradation | 故障时功能逐步变差,而不是整体不可用 | harvest 下降、yield 保持 |
| fault isolation | 把故障限制在局部 component/subsystem | partial failure containment |
| orthogonal mechanism | 与 application logic 独立的机制 | timeout、retry、sandbox、security、state repair |
| soft state | 可通过 refresh/repair 重新构造的 state | SRM、load balancing、multicast routing |
| strong CAP | strong consistency、high availability、partition-resilience 至多选二 | 论文的出发点 |
| Weak CAP | 三种 guarantee 中任意两项越强,第三项越弱 | 论文希望形式化的推广 |
目录
| 章节 | 内容 |
|---|---|
| 版本与来源 | HotOS-VII 版本和固定 PDF |
| 原文页面与逐页翻译 | 5 个 PDF 页面按原页保留 |
| 机制与设计判断 | harvest/yield、分解、orthogonality、soft state |
| 本篇验收 | 页数、图片、References 覆盖 |
版本与来源
- 论文标题:Harvest, Yield, and Scalable Tolerant Systems。
- 作者:Armando Fox(Stanford University)、Eric A. Brewer(University of California at Berkeley)。
- 版本:HotOS-VII,1999;题录可由 DBLP record 交叉核对。
- 本地固定来源:Berkeley RAD Lab author PDF。
- 本地固定文件:
source/harvest-yield-and-scalable-tolerant-systems.pdf。 - PDF 固定信息:5 页;SHA-256:
dd4f89bff6afa94d9960932ec678f4c68c5fa4d94048bc940d4bc06de1e34d3d。 - 附件处理:每页按原始 PDF 页面矩形以 2× 渲染为 PNG,存放于
assets/57 Harvest Yield and Scalable Tolerant Systems/,正文按600宽度嵌入。
原文页面与逐页翻译
第 1 页:动机、假设、相关工作与 Strong CAP

Harvest, Yield, and Scalable Tolerant Systems
作者:Armando Fox,Stanford University;Eric A. Brewer,University of California at Berkeley。
Abstract
在 Internet application 中,consistency、state management 与 high availability 之间的协调成本,会被前所未有的规模与 robustness 要求显著放大。本文提出两种提高整体 availability 的策略:使用简单、可扩展到大型 application 的 mechanisms,并利用 application output 能够 graceful degradation 的特性。
本文用 harvest 和 yield 描述这种 degradation,并把它们直接映射到工程机制:一方面通过 fault isolation 提高 availability,另一方面在某些情况下简化 programming。作者整理已有文献中的相关 techniques,展示这些方法可适用的 application 范围,希望推动更广泛的研究。
1. Motivation, Hypothesis, Relevance
基础设施服务现在不仅包括 routing,也包括 search engine、adaptation proxy 和 Web cache 等 application-level resources。这些 application 同样面对 routing infrastructure 的高 operational expectations 和指数增长的 user load,因此也需要类似规模的 hardware/software。
当前通过 commodity-PC clusters 获得 scalability 和 availability 的趋势,已经体现在最大的 Web server installations 中。这些 site 使用几十到几百台 PC,每天提供 1 亿次或更多 read-mostly page views,主要依靠简单 replication 或相对较小的数据集来提高 throughput。
这些 application 的规模,让著名的 consistency/availability trade-off 变得非常尖锐。本文提出构建大规模 robust systems 的两个方向:用简单的 composition mechanisms 促进 fault containment;把可能出现的 partial failure 转换为工程机制,使功能平滑降级而不是让整个服务不可用。方法源于 cluster computing;在此领域,自动处理 partial failure、同时保持 system management 可控,是公认的重大 software-engineering challenge。
2. Related Work and the CAP Principle
本文把 strong consistency 定义为 single-copy ACID consistency;假设 strongly-consistent system 能够执行 updates,否则讨论 consistency 没有意义。High availability 假设通过 redundancy(例如 data replication)提供;若某个 data consumer 始终能访问某个 replica,则称 data highly available。Partition-resilience 指整个 system 能够承受 data replicas 之间发生的 partition。
Strong CAP Principle
Strong Consistency、High Availability、Partition-resilience:至多选择两项。
- CA without P:提供 distributed transactional semantics 的 database,只能在 server peers 之间没有 network partition 时这样做。
- CP without A:发生 partition 时,ACID database 可以阻塞后续 transactions,直到 partition 修复,以避免产生 merge conflicts 和 inconsistency。
- AP without C:HTTP Web cache 通过 replication 保持 client/server partition resilience;但发生 client/server partition 时,不能验证过期 replica 的 freshness。一般地,distributed database problem 可以用 expiration-based caching 得到 AP,也可以用 replicas 加 majority voting 得到近似 CP,但 minority 会不可用。
第 2 页:Weak CAP、harvest/yield 定义与 probabilistic availability

实践中,很多 application 最好用 reduced consistency 或 reduced availability 描述。Bayou 等 weakly-consistent distributed database 提供明确的 consistency/availability trade-off;Coda 等 disconnected filesystem 明确选择 availability 而不是 strong consistency;基于 expiration 的 consistency mechanism(例如 leases)则提供 fault-tolerant consistency management。
这些例子暗示存在尚未被精确定义的 Weak CAP Principle:对于 strong consistency、high availability、partition resilience 三者中的任意两项,所作的 guarantee 越强,第三项能够提供的 guarantee 就越弱。
3. Harvest, Yield, and the CAP Principle
本文两种提高 availability 的策略都依赖于扩大 target application 的“correct behavior”概念,然后利用 CAP trade-off 在大规模环境中提升 availability。
假设 client 向 server 发出 queries。至少有两个 correct-behavior metrics:
- yield:请求完成的概率;
- harvest:response 中反映的数据占应有数据的比例,也就是 query answer 的 completeness。
Yield 是最常用的 metric,通常用“几个 9”衡量;“four-nines availability”表示请求完成概率为 0.9999。好的 HA system 通常追求 four 或 five nines。
发生 fault 时,通常需要在“不返回答案”和“返回不完整答案”之间选择:前者降低 yield,后者保持 yield 但降低 harvest。有些 application 不容忍 harvest degradation,因为任何偏离唯一正确行为的结果都无用;例如必须返回二值 presence/absence 的 sensor application 就不能接受输出降级。
另一些 application 能接受 harvest graceful degradation。online aggregation 允许 user 在大型数据集上做 arithmetic aggregation query 时,用运行时间换取 precision/confidence;它可以平滑地把 harvest 换成 response time,也适用于 approximate answer 和避免投入明显不值得的计算。
这种 degradation 看起来只适用于 query,但也能用于 single-location update:只影响一个 node(技术上一个 partition)的 update。影响 reachable nodes 的更新可以正确发生,但可见性有限,即 reduced harvest;需要 unreachable nodes 的 update 则失败,即 reduced yield。只要新 values 尚未 everywhere available,这些局部更新仍保持 consistency。该模型不适用于 global changes,但对 personalization database、collaborative filtering 等实用 application 很有帮助。
4. Strategy 1: Trading Harvest for Yield—Probabilistic Availability
几乎所有 system 实际上都是 probabilistic 的。即使 single fault 下能 100% available,只要 multiple failures 具有非零概率,整体 availability 就是 probabilistic;Internet server 还依赖 best-effort Internet。因此 availability 很自然地映射到 probabilistic approach,需要直接讨论它,以理解并限制 fault impact。
以 Inktomi search engine 为例:node fault 会删除与 node 成比例的一部分 search database。100-node cluster 中单 node fault 会使 fault duration 内 harvest 降低 1%。随机把 data 放到 nodes 上,可使丢失的 1% 也是随机的,从而让 average-case 与 worst-case fault behavior 接近。对高优先级 data 做 replication,则可以降低该 data 丢失的概率,更精确地控制 harvest。
当然可以复制全部 data,但代价很高,对 harvest/yield 的实际收益可能很小,而且受 best-effort Internet protocol 影响,永远不能保证 100% harvest 或 yield。
thin-client 的 transformation proxy 也会按 client capabilities 主动降低 output,从而以 harvest 换 yield;即使完整结果有用,在 client/server bandwidth 受限时,也可以把 response time 换 harvest,例如降级为 low-bandwidth format。
第 3 页:Application decomposition 与 orthogonal mechanisms

5. Strategy 2: Application Decomposition and Orthogonal Mechanisms
一些大型 application 可以拆分成多个 subsystem:每个 subsystem 单独看都不能容忍 harvest degradation(故障表现为 yield 下降),但某个 subsystem 单独失败时,整体 application 仍能以较低 utility 继续工作。于是整体 application 能容忍 harvest degradation。
好的 decomposition 至少有一个 actual benefit 和一个 potential benefit。Actual benefit 是可以分别 provision 每个 subsystem 的 state management:只为确实需要的 subsystem 提供 strong consistency 或 persistent state,而不是为整个 application 提供。若只有少数小 subsystem 需要额外复杂度,节省会非常可观。
典型 e-commerce site 可以拆为:
- read-only subsystem:根据 user profile 从 static corpus 生成内容;
- transactional subsystem:billing;
- 只需在 session 期间 persistent 的 shopping cart;
- 真正 persistent、read-mostly/write-rarely 的 personalization profile。
除 billing 外,这些 subsystem 任何一个失败都不必让整个服务无用。profile store 失败时,user 仍能浏览商品,只是失去个性化展示;shopping cart 失败时,仍可一次购买一个商品,依此类推。
传统上,不同 state-management requirements 和 data semantics 的 subsystem 之间有 narrow interface layers。本文认为,如果能识别 orthogonal mechanisms,有时可以做得更好。Layered mechanism 位于上下层之间;orthogonal mechanism 则独立于其他 mechanisms,几乎没有 runtime interface(最多只有 configuration interface)。
Brooks 指出 software project complexity 随 engineer 数量平方增长;Leveson 的证据则表明,复杂系统多数 failures 来自 unexpected inter-component interaction,而非 component 内部 bugs。因此 machinery 越少越好,且往往是 quadratic 地更好。能够使用 orthogonal mechanisms,是 decomposition 的第二个 potential benefit。
5.1 Programming With Orthogonal Mechanisms
出乎预料的是,orthogonal mechanisms 在实践中并没有描述上那么受限。cluster-based Scalable Network Server(SNS) 是一个已部署的例子:它为 PC cluster 提供 high availability 和 incremental scaling,但不提供 persistent state management 或 data-consistency guarantees。
SNS 对 hosted application 的 programming requirement 是:每个 application module 可以在几乎任意时间 restart。这个约束并不简单,但允许 SNS 使用 timeouts、retries、sandboxing 等简单 orthogonal mechanisms,自动处理 cluster 中的 transient faults 和 load imbalance,同时保持 module availability 并完成基本 load balancing。
尽管 SNS 没有 state maintenance,且要求 restartability,作者仍用它部署了 MediaPad:一个 adaptation proxy,使 PalmPilot 能参与 multi-user shared whiteboard session。MediaBoard 和 MediaPad 使用 SRM(Scalable Reliable Multicast)作为通信协议;group/session state 没有 hard copy,而由各 peer 保存 soft copy,并由 multicast-based repair mechanism 做 collaborative state maintenance。crash recovery 通过 repair mechanism refresh soft state,符合 SNS 的 restartable-worker constraint。state maintenance 与 SNS orthogonal,因为无需修改 SNS 的 interface 或 behavior。类似 technique 也用于在 SNS 上 prototype real-time streaming media server。
5.2 Related Uses of Orthogonal Mechanisms
组合 orthogonal subsystems 会把潜在有害 interaction 的检查从 runtime 移到 compile time;部署 orthogonal guard mechanisms 则能通过 fault containment 提高运行时 robustness。因此 application writer 不必直接处理 incremental scaling(replication、load management)和 high availability;SNS 的简单 mechanisms 可为所有 application 提供这些能力。
orthogonality 并不新鲜:stack-overrun guard、system-call monitoring、software fault isolation 都是 orthogonal safety 的例子;SSL 则用 out-of-band handshake 建立 secure channel,把 privacy 和 data integrity 作为 orthogonal capability 叠加到任意 stream connection 上。
第 4 页:机制案例、总结与研究议程

orthogonal approach 特别适合给最初没有 security 或 robustness 的 legacy application 增加 operational features,而不要求修改 core application code。safety-critical systems 社区长期使用此类机制;Therac-25 radiation-therapy machine 中移除 mechanical interlock 后暴露出 software race condition,最终导致 patient fatalities。这类事件虽然多为 anecdotal evidence,却支持“使用小 state space 的简单 failsafe mechanism”的设计原则。本文的贡献是识别这些 techniques 的组合,并指出它们与 compile-time orthogonal composition 配合时可能提高 robustness。
6. Discussion and Research Agenda
本文给出了两个已实现的例子,把 harvest degradation 映射到具体 mechanisms:工程 tractability、通过 redundancy 获得 availability,以及其他 operational features。
- 对 Inktomi search engine,per-node timeout constraint 使整体 yield 保持不变,代价是 probabilistic harvest degradation。一般来说,它把 faults 映射为 harvest 而不是 yield 的下降,因此几乎总能返回 probabilistically good answer(但 yield 不可能达到 100%)。
- 对 SNS cluster-based application server,要求 application module restartable,使其可以使用 timeouts、retries 等简单 scaling/reliability mechanisms;restartability 则由 SRM 这样的 orthogonal state-maintenance mechanism 支持。
作者总结出几类可简化 engineering、提高 robustness/scalability 的 mechanism:
- 小 state space 的简单 mechanisms:behavior 易于 reasoning,例如 timeout-based partial-failure handling、guard timers、orthogonal security;它们受到 safety-critical systems 中 orthogonal mechanisms 的启发。
- 把 mechanisms orthogonalize 到 application logic 之外:将 application functionality 与 high availability 分离;SNS 与 SRM 的组合是例子。
- 用可 refresh 的 soft state 替代 hard state:常见副作用是 recovery code 与 mainline code 相同;SNS 的 load-balancing manager 就使用了受 IP multicast routing 和 SRM state repair 启发的 soft-state mechanism。
- 保持大规模 hardware replication/redundancy 的总体 tractability:真正能在规模和 aggregate capacity 上与 cluster-based Internet service 相比的专用系统非常少。
仍需形式化描述能够容忍 graceful harvest degradation 的 application,包括由不能降级、可能 orthogonal 的 subsystem 组成的 application。作者预期,形式化 characterization 会产生一种 programming model,为 degraded result 提供 first-class abstractions。若能形式化 deployment framework,它就等价于对 Weak CAP Principle 的 constructive proof。
传统上,面向 incremental scalability/high availability 设计的 application,与不考虑这些 constraints 的 application 不同。本文发现,尽管所用 engineering techniques 很简单,它们仍能支持令人意外的 application 范围。简单 techniques 用来降低 programming task 的难度;有良好 fault isolation 的 techniques 则用来保留 cluster 原有的 fault-isolation 优势。SNS 特别说明:只要 application structure 能与简单 orthogonal mechanisms 的 constraints 协调,就可以把 scalability/availability concerns 从 mainline application design 中分离出来。
作者希望推动更广泛的研究,形成覆盖 ACID 到 BASE 的 large-scale robust application design guidelines。本文把这些初步 observations 作为第一步。
作者感谢 anonymous reviewers 以及 Stanford、Berkeley 的同事。
第 5 页:References

REFERENCES
- F. Brooks. The Mythical Man-Month: Essays on Software Engineering. Addison–Wesley, 1975(1995 revised ed.)。
- Y. Chawathe and E. A. Brewer. System support for scalable and fault tolerant internet service. Middleware ’98。
- C. Cowan et al. StackGuard: Automatic adaptive detection and prevention of buffer-overflow attacks. USENIX Security Symposium, 1998。
- S. B. Davidson, H. Garcia-Molina, and D. Skeen. Consistency in partitioned networks. ACM Computing Surveys 17(3), 1985。
- A. Demers et al. The Bayou architecture: Support for data sharing among mobile users. Workshop on Mobile Computing Systems and Applications, 1994。
- S. Floyd et al. A Reliable Multicast Framework for Light-Weight Sessions and Application Level Framing. ACM SIGCOMM ’95。
- A. Fox and E. A. Brewer. Reducing WWW Latency and Bandwidth Requirements via Real-Time Distillation. WWW-5, 1996。
- A. Fox, S. D. Gribble, Y. Chawathe, and E. A. Brewer. Adapting to network and client variation using active proxies: Lessons and perspectives. IEEE Personal Communications, 1998。
- A. Fox, S. D. Gribble, Y. Chawathe, E. A. Brewer, and P. Gauthier. Cluster-Based Scalable Network Services. SOSP 1997。
- A. O. Freier, P. Karlton, and P. C. Kocher. SSL version 3.0. Internet Draft, 1996。
- I. Goldberg, D. Wagner, R. Thomas, and E. A. Brewer. A secure environment for untrusted helper applications: Confining the wily hacker. USENIX Security Symposium, 1996。
- C. G. Gray and D. R. Cheriton. Leases: An efficient fault-tolerant mechanism for distributed file cache consistency. Stanford technical report, 1990。
- J. Gray. The transaction concept: Virtues and limitations. VLDB, 1981。
- J. M. Hellerstein, P. J. Haas, and H. J. Wang. Online aggregation. SIGMOD, 1997。
- Inktomi Corporation. The Inktomi technology behind HotBot, 1996。
- J. J. Kistler and M. Satyanarayanan. Disconnected Operation in the Coda File System. ACM TOCS 10(1), 1992。
- N. G. Leveson. Safeware: System Safety and Computers. Addison-Wesley, 1995。
- N. G. Leveson and C. S. Turner. An investigation of the Therac-25 accidents. IEEE Computer, 1993。
- S. McCanne et al. Toward a common infrastructure for multimedia networking middleware. NOSSDAV 1997。
- National Laboratory for Applied Network Research. The Squid internet object cache。
- NCR Corp. Teradata scalable RDBMS。
- G. F. Pfister. In Search of Clusters. Addison-Wesley, 1998。
- A. Schuett et al. A soft state protocol for accessing multimedia archives. NOSSDAV 1997。
- R. Wahbe et al. Efficient Software-Based Fault Isolation. SOSP 1993。
机制与设计判断
1. Harvest 与 yield 的分工
yield 询问“这次请求有没有完成”;harvest 询问“完成的答案有多完整”。传统 availability 只看 yield,但 Internet-scale service 可以选择尽量保持 yield、接受 harvest 的平滑下降。这个区分使“部分正确的答案”成为可设计、可测量的 behavior,而不是简单地被归类为 failure。
2. 两条可扩展性路线
| 路线 | 核心机制 | 故障表现 |
|---|---|---|
| Trading harvest for yield | random placement、priority replication、timeouts、adaptive degradation | 服务继续返回,答案 completeness 下降 |
| Application decomposition | 独立 subsystem、不同 state-management strength | 局部功能消失,整体服务保留 |
| Orthogonal mechanisms | SNS、SRM、sandbox、retry、soft-state repair | 运行时 fault isolation 与 scaling 独立于业务逻辑 |
3. 与 CAP 的关系
Strong CAP 给出了离散的“至多两项”;本文进一步关注现实系统中连续的 trade-off:consistency、availability 和 partition resilience 的 guarantee 可以各自分级。harvest/yield 的概念和 subsystem decomposition,正是把“第三项变弱”变成应用可接受的 graceful degradation。
本篇验收
- [x] 5 个 PDF 页面均有对应页面标题和原始页面图。
- [x] 5 张 PNG 均按
harvest-yield-p01.png至p05.png顺序嵌入。 - [x] Abstract、Strong/Weak CAP、harvest/yield 定义、两条 strategy、SNS、SRM、orthogonal mechanisms、soft state、Discussion 和 24 条 References 均已覆盖。
- [x] 保留 harvest、yield、CAP、fault isolation、orthogonal mechanism、soft state 等关键术语。
- [x] 已记录本地 PDF、来源 URL 和 SHA-256;待专栏索引和总计划登记后完成全库 checker/lint 验收。
评论 (0)