Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
248
|
第
14
章
领导者和跟随者都依靠心跳机制来确定远程进程的活动性。如果领导者未从 Quorum 的
跟随者那里接收到心跳,它将不再担任领导者并重新发起选举。同样地,如果某个跟随
者认为领导者已经崩溃,它将发起新的选举。
消息是完全有序的,在上一条消息确认之前,领导者不会尝试发送下一条消息。即使某
些消息被跟随者收到不止一次,但只要遵循顺序传递,重复应用消息也不会产生其他副
作用。ZAB 能处理多个并发的状态更改,因为唯一的领导者将会接收写入请求、建立事
件的顺序并广播更改。
消息完全有序也提高了 ZAB 的恢复效率。在同步阶段,跟随者回复序列号最高的已提
交提案。领导者可以简单地选择具有最高提案的节点用于恢复,这可以是唯一的需要从
中复制消息的节点。
ZAB 的一个优点是效率高:广播过程仅需两轮消息,而且领导者故障只需从一个最新的
进程中获取缺失消息就可以恢复。拥有长期领导者对性能是有利的:我们不需要额外的
共识回合来确立一致的事件历史,因为领导者可以根据其本地视图决定事件顺序。
14.3 Paxos
在可能出现崩溃故障的异步系统中,原子广播等价于共识问题 [CHANDRA96],因为参
与者必须能得知消息顺序并对其达成
一致
。你将会看到原子广播和共识算法在目标和实
现方面存在许多相似之处。
最广为人知的共识算法可能是
Paxos
,该算法最初由 Leslie Lamport 在“ The Part-Time
Parliament”这篇论文 [LAMPORT98] 中提出。论文中,作者借助 Paxos 岛的立法及投票 ...
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