Gossip protocol 像 epidemic 一樣傳資訊:每個 informed node 定期聯絡少量 random target。Duplicate message 看似浪費,卻移除 central bottleneck,也讓 dissemination 能承受單點 message loss。
Push、pull、push-pull
- Push: informed node 主動送 update。
- Pull: node 問 peer 自己漏了什麼。
- Push-pull: 雙方交換 summary 與 update。
Push 在初期散播快;pull 在接近完成時有效;hybrid 橫跨兩個階段。Constant fanout 通常能以 logarithmic rounds、高機率覆蓋大型 group,但不是 absolute guarantee。
Membership 是持續變動的 view
Membership service 追蹤哪些 process 被相信仍在 group。大型系統不能讓每個 member probe 所有人,因此 gossip-style protocol 傳 join、leave、heartbeat 與 suspicion。
Asynchronous network 裡 failure detection 天生不完美。漏 heartbeat 可能是 crash、congestion、delay 或 partition。
白話來說: Failure detector 不是偵測死亡,而是偵測 response 錯過 deadline。
Suspicion 比立即移除安全
alive → suspected → failed
│
└── refutation/heartbeat → alive
Indirect probe 請其他 node 聯絡失聯 target,能分清壞 path 與壞 process,降低 false positive。Suspicion timeout 則讓反證有時間抵達。
不只比較 detection speed
| Metric | 問題 |
|---|---|
| Detection time | 真故障多久被懷疑? |
| Mistake rate | 多常誤判 live member? |
| Mistake duration | False suspicion 持續多久? |
| Message load | Detection 產生多少 traffic? |
Timeout 越緊,detection 越快,mistake 也越多。不存在 universally best detector;要依 network variance、false eviction 與 slow failover 的代價調整。
複習卡
- Gossip 用 duplicate message 換 decentralization 與 robustness。
- Push 擅長初期,pull 幫助完成覆蓋。
- Membership 是 local、持續變動的 belief,不是瞬時 global truth。
- Timeout 無法分清 failure 與 delay。
- Suspicion/indirect probe 降低過早 eviction。
- 以 speed、mistake、duration、message cost 共同調參。