Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
共识
|
253
提议者
接受者
图
14-6
:
Paxos
故障场景:提议者故障之后接受者故障
Paxos 算法能容忍接受者故障,但剩余的接受者必须足以构成多数派。
14.3.4 Multi-Paxos
到目前为止,我们讨论了经典的 Paxos 算法。在该算法中,我们选择任意一个提议者来
尝试发起 Paxos 回合。这个方法存在的一个问题是,系统中的每轮复制都需要进行一
轮提议。只有当选出提议者之后(即多数派的接受者向某一提议者回应 Promise 消息
时),才会进入复制阶段。为了避免重复进行提议阶段,使提议者可以重用已被认可的地
位,我们可以使用 Multi-Paxos。Multi-Paxos 引入了
领导者
的概念
—
提议者的负责人
(distinguished proposer)[LAMPORT01]。这一补充十分关键,能显著提升算法的效率。
有了一个已确立的领导者,我们就可以跳过提议阶段,直接进行复制:分发值并收集接
受者的确认。
经典 Paxos 算法中,读取可以通过执行一轮 Paxos 回合实现,它从不完整的回合(如果
存在的话)中收集值。之所以必须这么做,是因为最后一个已知的提议者无法保证一定
包含最新的数据,可能另一个提议者已经修改了状态,而当前提议者并不知道。
Multi-Paxos 中也可能发生类似的情况:我们试图从已知的领导者进行读取,但此时
另一位领导者已经当选,那么请求将返回过期的数据,这就违背了共识的可线性化
(linearizability)保证。为了避免这种情况并确保其他进程都无法成功地提交值 ...
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