復旧の連鎖とループ:システム全体の安定性を損なう相互作用

#Tech

システムやコンポーネント間の相互作用は、タイムアウトの誤解釈など、予期せぬ不具合を引き起こし、連鎖的な復旧を発生させる可能性がある。

特に、システムAの復旧がシステムBに過剰な負荷をかけ、メッセージバスへのデータリクエストを増加させることで、復旧ループを引き起こすことがある。

この現象は、データ不足に対する再計算や、既に取り込んだデータの再取得といった、コストのかかる処理を発生させる。

システム全体の安定性を保つためには、段階的な復旧を設計し、リソース使用量を抑えることが重要。

システム障害からの復旧プロセス自体が、新たなシステム負荷や連鎖的な問題を引き起こす可能性があるという点が注目されています。メタ社などの大手テック企業が取り組むSRE(Site Reliability Engineering)の分野で、この「復旧の連鎖(Cascading Recovery)」に関する研究が進められています。

復旧プロセスが引き起こす連鎖的な負荷

システム障害が発生すると、通常は影響範囲を限定する対策(サイロ化など)が取られます。しかし、障害からの「復旧」のプロセスは、直接的な障害とは異なり、静かに、そしてより広範囲に影響を及ぼすことがあります。あるシステムAが復旧する際、依存しているシステムBに対して大量の未処理データ(バックログ)を一気に送りつけることで、Bの負荷が急増する現象が指摘されています。これは雪崩のように負荷が増幅していく連鎖反応です。

フィードバックループによる無限の負荷増大

さらに深刻なのは、復旧の連鎖がフィードバックループを生み出す点です。例えば、データ処理システムにおいて、データが遅れて到着したために消費側で再計算が必要になった場合、その再計算のために古いデータを再取得する負荷がメッセージバス側に逆流します。この逆流した負荷がメッセージバスの処理速度を低下させ、結果としてさらに多くの再計算が必要になるという悪循環(ループ)が発生するとのことです。

復旧の前提条件のズレ(ミスマッチ)

このような負荷増幅の根本的な原因は、「システムが持つ前提条件」と「実際の環境」との間にズレ(ミスマッチ)が生じることにあります。システムは通常、データが時間通りに届くことを前提に設計されていますが、障害によるデータ欠損や遅延が発生すると、システムは想定外の「復旧アクション」を強いられます。この想定外の動作こそが、予期せぬコスト増大やシステム全体の不安定化を招いていると分析されています。

まとめ

従来のエンジニアリングでは「障害の伝播」を防ぐことに注力されてきましたが、今後は「復旧プロセスの伝播」という新たな視点が必要とされています。システム設計において、復旧時の負荷増大やフィードバックループを考慮した設計思想が求められています。

原文の冒頭を表示(英語・3段落のみ)

My last metastable blog post discussed the interactions between systems and components and how they can lead to metastable failures. Specifically, I looked at interactions between systems/components and how signals can be misinterpreted by different systems due to ambiguity — a timeout may mean a transient fault that can be fixed by retrying, but it may also mean a catastrophic overload where retrying only makes things worse. This leads to an important realization: some common action systems take in response to signals can be good under some assumptions and bad under others.

Last month, Todd Porter from Meta, Dave Maier from Portland State, and I gave a talk at SREConn Americas on Metastability in Recovery. This talk discusses how cross-system interactions and ambiguous assumptions can make recovery of system of systems impossible due to cascading amplifications and feedback loops.

It is a common fact that failures can spread. A lot of engineering effort is often put into siloing/compartmentalizing systems to reduce the blast radius. But if failures can spread, so do the recoveries from failures. Failures (often) spread visibly — as one system starts to affect another, alarms begin to sound on the newly affected system. The recoveries spread differently and often more silently. Even if we successfully isolate failures and prevent them from propagating directly to other components, it does not mean that recoveries from these failures will not spread. Consider two systems: A and B; system A experiences a problem, but the problem remains isolated to A. However, system B usually receives its work from A, and while A is failing, it sends less work to B. The recovery of A, however, can be rather unexpected to B — it now starts receiving all the work, and maybe more, as A’s recovery tries to process and ship the backlog to B.

※ 著作権に配慮し、引用は冒頭3段落までです。続きは元記事をご覧ください。

元記事を読む ↗