Vector clocks

给定的 Lamport 时间戳 \(L(a)\) 和 \(L(b)\) 并且 \(L(a) < L(b)\),我们推断不出 \(a \rightarrow b\) 或者 \(a || b\).1 要区分平行的这些事件,需要 vertor clocks: 假定分布式系统中有 \(n\) 个节点,\(N = \langle N_{1},...

Distribution System

Remote Procedure Call Remote Procedure Call (RPC) 使得调用远程函数就像调用本地函数一样,这样就不需要关心资源的具体问题,实际上 RPC 是将方法调用转换成了网络通信。但是遇到通信失败怎...

Causality and Happen-before relation

The Happens-before relation An event is something happening at one node (sending or receiving a message, or a local execution step). event \(a\) happens before event \(b\), written \(a \rightarrow b\). 那么在分布式,有三种情况,满足其中一条,则 \(a\) 是发生在 \(b\) 之前: \(a\) 和 \(b\) 发生在相同节...

Causal broadcast

Definition Causal broadcast 算法有点类似于 FIFO broadcast: 每条被广播的消息附上的不是一个序列号,而是一个整数的向量。这种算法有时被称为向量时钟算法,向量时钟...

Lamport clocks

Lamport clocks algorithm Lamport clocks in words Figure 1: lamport-example-simple 每个节点都维护一个计数器 \(t\),每一个当前节点事件 \(e\) 发生时,自增 1。 增长后的值设为 \(L(e)\) 发送消息时附带上当前的计数 \(t\) 消息...

Quorum

Quorum 机制,是一种分布式系统中常用的,用来保证数据冗余和最终一致性的投票算法,其主要数学思想来源于鸽巢原理。 基于 Quorum 投票的冗余控制算法 在有冗余数据...

Stub

在开发过程中,stub 很多时候就是针对不可控制的部分进行模拟,例如 Mock。 在分布式中,stub 就是用于转换远程过程调用(RPC)期间客户端...

Remote Procedure Call (RPC)

Remote Procedure Call 是一种=软件通信协议=,程序可以在不了解网络细节的前提下,向位于网络上的另外一台计算机中的本地程序请求服务。PRC 被用来像本地系统一样...

Network Time Protocol (NTP)

Network Time Protocol (NTP) is an internet protocol used to synchronize with computer clock time sources in a network. It belongs to and is one of the oldest parts of the TCP/IP suite. The term NTP applies to both the protocol and the client-server programs that run on computers. Mac 中可以在设置中找到 NTP 服务器的地址,比如下...

The Byzantine generals problem

拜占庭将军问题(Byzantine Generals Problem),是由莱斯利·兰波特在其同名论文中提出的分布式对等网络通信容错问题。 在分布式计算中,不同...