Auto-sync: 2026-04-16 17:30

This commit is contained in:
2026-04-16 17:30:41 +08:00
parent b2250c60b2
commit c999498de4
662 changed files with 3797 additions and 21340 deletions

View File

@@ -1,33 +1,24 @@
---
title: "Kill Switch"
type: concept
tags: [DevOps, FeatureFlag, 可靠性工程]
last_updated: 2026-04-16
tags: [紧急恢复, 持续交付, 风险管控]
sources: ["https://launchdarkly.com/blog/rto-vs-rpo/"]
last_updated: 2025-07-26
---
## 定义
Kill Switch紧急开关Feature Flag 的紧急应用场景,可在生产环境出现故障时一键关闭问题功能,无需重新部署代码。
## Definition
Kill Switch紧急关闭开关)是一种紧急机制,允许在发现问题时立即禁用某个功能,而不需要重新部署代码。
## 核心价值
- RTO 保险策略:问题发生时 Flip the Flag 而非 Debug under pressure
- 数据完整性保护:在 bug 持续破坏数据时立即止损,比等待完整回滚部署更快
## Use Cases (from this source)
- 支付处理器异常?切换到备用提供商
- 搜索结果异常?回退到旧算法
- AI 模型产生幻觉?切换回上一版本
## 典型应用场景
- 支付网关故障:立即切换到备用支付提供商
- 搜索算法异常:回退到旧的搜索算法
- AI 模型产生幻觉:切换回上一稳定版本
- 数据库迁移导致性能下降:仅回滚该变更而非整个部署
## 与 Feature Flag 的关系
- Kill Switch 是 Feature Flag 的一种高级应用
- Feature Flag 提供 Kill Switch 的工程基础(部署与发布解耦)
## 与 RTO 的关系
- Kill Switch 将 RTO 从"部署回滚时间"降至"配置变更时间"(秒级)
- HP 案例:从小时级降至分钟级
- Christian Dior 案例:从 15 分钟降至即时开关
## Benefits
- 将 RTO 从小时级降至秒级
- 无需在压力下调试
- 保护用户数据和体验
## Connections
- [[Feature Flag]] ← Kill Switch 的工程基础
- [[RTO]] ← 通过 Kill Switch 实现秒级 RTO
- [[LaunchDarkly]] ← 企业级 Kill Switch 平台
- [[Feature Flag]] ← 实现方式 → [[Kill Switch]]
- [[RTO (Recovery Time Objective)]] ← 降低工具 → [[Kill Switch]]