paxos

Programming language to choose for implementing distributed message passing algorithms

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 04:39:29
问题 Basically, I would want to implement the following algorithms and analyze how the system built using these algorithms behave under different conditions. Gossip protocol Multiple paxos Consistent hashing My interest here is in these algorithms. I basically am looking for a programming language that lets me write these algorithms quickly and deeply understand these algorithms. Which language should I choose? Java, Scala, Erlang or anything else. Currently, I know Java and C++. 回答1: You could

Paxos学习笔记

此生再无相见时 提交于 2019-12-20 23:28:07
最早发表的《The Part-Time Parliament》历史有点久远了,先略过不读。 一、《Paxos Made Simple》 这是Lamport 2001年写的基本上是《The Part-Time Parliament》的简化版本。Lamport在文中强调的是Paxos的两阶段执行过程(准备阶段和接受阶段),最后的Phase 3没有被当作独立的阶段(但文章用独立章节2.3介绍了Phase3即学习阶段)。 Paxos 问题描述 为了方便描述和分析这个问题,做了如下定义 决议(Valule):要解决的问题,这里定义为选择一个决议(Valule) 议案(Proposal):任何进程对这个的一个提议,我们叫做一个议案 三种角色:提议者Proposer(提出一个议案),批准者Acceptor(同意这个议案),学习者Learner(获知结果)。一个进程可以同时兼任这几个角色。 对结果的限制 : 只有被提出过的值可以被选择 只有一个值可以被选择 一个进程不会知道一个值被选择了,除非这个值真的被选择了(也就是没有错误信息)。 总体而言,问题的目标是保证,如果有一些值被提议了,那最终会有一个值会被选择通过,如果一个值被选择通过了,任一进程最终都会得知这个结果。值得注意的是,在这里,最终哪个值被选择了不重要(显然如果每个进程都坚持自己的议案,那永远不能达成一致),重要的是有一个值最终被选择了

图解分布式一致性协议Paxos

≡放荡痞女 提交于 2019-12-20 21:05:32
Paxos协议/算法是分布式系统中比较重要的协议,它有多重要呢? <分布式系统的事务处理> : Google Chubby的作者Mike Burrows说过这个世界上只有一种一致性算法,那就是Paxos,其它的算法都是残次品。 <大规模分布式存储系统> : 理解了这两个分布式协议之后(Paxos/2PC),学习其他分布式协议会变得相当容易。 学习Paxos算法有两部分:a) 算法的原理/证明;b) 算法的理解/运作。 理解这个算法的运作过程其实基本就可以用于工程实践。而且理解这个过程相对来说也容易得多。 网上我觉得讲Paxos讲的好的属于这篇: paxos图解 及 Paxos算法详解 ,我这里就结合 wiki上的实例 进一步阐述。一些paxos基础通过这里提到的两篇文章,以及wiki上的内容基本可以理解。 算法内容 Paxos在原作者的《Paxos Made Simple》中内容是比较精简的: Phase 1 (a) A proposer selects a proposal number n and sends a prepare request with number n to a majority of acceptors. (b) If an acceptor receives a prepare request with number n greater than

这个小姐姐说:你之前所知道的区块链可能都是错的

一世执手 提交于 2019-12-19 23:28:29
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 随着币价的一直下跌,有传言说,比特币价格此次崩盘,只是大 BOSS 吴忌寒为加速淘汰老旧矿机而祭出的绝招。 无论这个阴谋论真假与否,在整个区块链行业的凛冽寒冬中,价格的涨跌已经左右了太多的人头脑之中的理智。可是,众人之中,究竟有几个人真正理解了区块链技术的密码学机制与分布式计算?究竟有几个人还会关心区块链在技术上的创新? 尘归尘,土归土。可能只有巨大的泡沫消散之后,区块链才能通过技术创新显示出真正的影响力。让区块链回归技术与应用的本质,这也是我们一直以来的定位。然而,传播这样的内容和话题,离不开货真价实的技术干货,以及有感染力的人物和故事。 我们今天的内容就来自于这样一个女生: 她是工业与系统工程专业出身,做过顶级投行高盛的分析师,做过著名风投 a16z 的合伙人——这都是许多人梦寐以求的工作。但是,功成名就的路上,她却发现编程才是自己想要的生活。 笨办法学会编程?她没学会。如何用 HTML/CSS 做一个网页?她开始上瘾了。所以,没有选择斯坦福、MIT 的编程学位,她更喜欢 Hack Reactor 的全栈动手实践。先学 JavaScript、React,后面的想法是机器学习、计算机视觉……这个女生就是 Preethi Kasireddy。 接触区块链之后,金融从业背景和全栈编程能力让 Preethi

In Paxos, can an Acceptor accept a different value after it has already accepted one?

旧时模样 提交于 2019-12-19 07:46:07
问题 In Multi-Paxos algorithm, consider this message flow from the viewpoint of an acceptor: receive: Prepare(N) reply: Promise(N, null) receive: Accept!(N, V1) reply: Accepted(N, V1) receive: Accept!(N+1, V2) reply: ? What should the acceptor's reaction be in this case, according to the protocol? Should it reply with Accepted(N+1, V2), or should it ignore the second Accept!? I believe this case may happen in Multi-Paxos when a second proposer comes online and believes he is (and always was)

paxos vs raft for leader election

柔情痞子 提交于 2019-12-17 23:25:28
问题 After reading paxos and raft paper, I have following confusion: paxos paper only describe consensus on single log entry, which is equivalent the leader election part of the raft algorithm. What's the advantage of paxos's approach over the simple random timeout approach in raft's leader election? 回答1: It is a common misconception that the original Paxos papers don't use a stable leader. In Paxos Made Simple on page 6 in the section entitled “The Implementation” Lamport wrote: The algorithm

Why is it legit to use no-op to fill gaps between paxos events?

半世苍凉 提交于 2019-12-14 00:51:25
问题 I am learning Paxos algorithm (http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) and there is one point I do not understand. We know that events follow a timely order, and it happens when, say, events 1-5 and 10 are decided, but 6-9 and 11 thereafter are not yet. In the paper above, it says we simply fill in the gap between 6-9 with no-op values, and simply record new events from 11 and on. So in this case, since event 10 is already recorded, we know some kinds of

How to make sense of Phase 2 in Paxos distributed consensus algorithm?

狂风中的少年 提交于 2019-12-13 20:10:39
问题 I have pasted pseudocode for a paxos algorithm here: What is a "view" in the Paxos consensus algorithm? and was wondering if someone could point me in the right direction. The algorithm says that each node has a "state" which contains a bunch of information the node should keep track of. Suppose we have two nodes: Node #1 and Node #2. In the simplest case Node #2 joins Node #1 and they both play paxos. What exactly happens to the states of Node #1 and Node #2 after 2 joins 1? When does the

Why is multi-paxos called multi-paxos?

浪子不回头ぞ 提交于 2019-12-13 12:27:04
问题 Why multi-paxos is called multi-paxos? I can't see how it is "multi". 回答1: It's about multiple rounds of the algorithm to agree sequential requests from a stable leader with minimal messaging. Initially with no recognised leader you must run at least one round of basic Paxos where a candidate leader sends a prepare request (using the terminology of the paper Paxos Made Simple). Positive responses from a majority confirm it as leader. It then sends accept messages for that round which

some questions about paxos

可紊 提交于 2019-12-13 07:33:26
问题 i am confused by the value chose by proposer. use a example to explain. If now a proposer wants to lock a file, then it will send that l1 is the processer_number, and v1 is the value of "lock the file", and acceptors accept it. than the proposer wants to unlock the file, and sends (l2 > l1)that v2 is the value of "unlock the file", after that, acceptor return the last value and proposer picks it and send again. in this example, v2 is lost? or what is the real process in this example? also,