Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
176
|
第
9
章
时间戳列出了心跳计数器上次递增的时间。每个成员定期递增其心跳计数器,并将其列
表分发给随机相邻节点。在接收到消息时,相邻节点将列表与它自己的列表进行合并,
更新其他相邻节点的心跳计数器。
节点还定期检查状态列表和心跳计数器。如果任何节点在足够长的时间里没有更新其计
数器,就认为它发生了故障。超时时间应当谨慎选择,以将误报的概率降至最低。成员
之间通信的频率(换句话说,最坏情况下所使用的带宽)是有上限的,并且最多可以随
着系统中的进程数线性增长。
图 9-4 展示了共享心跳计数器的三个通信进程:
•
a) 这三个进程都可以进行通信并更新它们的时间戳。
•
b) P
3
不能与 P
1
通信,但它的时间戳 t
6
仍然可以通过 P
2
传播。
•
c) P
3
崩溃了。由于不再发送更新,它被其他进程检测认定为故障。
a) b) c)
图
9-4
:用于故障检测的复制心跳表
通过这样的方式,我们就可以检测出崩溃的以及任何其他集群成员都无法访问的节点。
这个决策是可靠的,因为集群的视图是来自多个节点的聚合。如果两台主机之间的链路
出现故障,心跳仍然可以通过其他进程传播。使用 Gossip 来传播系统状态增加了系统中
的消息数量,但使得信息传播更可靠。
9.4
反向故障检测
由于并不总是能传播故障的信息,并且通过通知每个成员来进行传播可能成本较高,因
此出现了一种称为
FUSE
(Failure Notification Service,故障通知服务)[DUNAGAN04]
的方法,它专注于可靠且廉价的故障传播,即使在网络分区的情况下也能工作。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787111655169