跳到主要内容

解决方案概要

数据库中的一个条目是一个五元组:

(S,V,F,CT,T) where
S is an selector used in all references to this entry.
V is its present value.
F is a deleted/undeleted flag.
CT is the timestamp of the creation of this entry.
T is the timestamp of the modification which set the current V
and/or F of the entry.
A timestamp is a pair (time,DBMP) where the DBMP identifies the
site at which the time was generated, and the DBMPs are
(arbitrarily) ordered, so that timestamps are completely
ordered.

一次修改是一个对 (Set-of-DBMPs,Entry),其中 Set-of-DBMPs 是该条目尚未投递到的 DBMP 的集合。

每个 DBMP 保存一份(按时间戳)有序的修改列表。DBMP 定期尝试把修改请求投递给仍在每个修改所关联的 Set-of-DBMPs 中的那些 DBMP。当修改条目已投递给所有 DBMP 后,将其从该列表中移除。

当 DBMP 收到来自另一个 DBMP 的修改请求时,它把该请求的时间戳与其数据库中对应条目(如果有)的时间戳比较,并据此对新条目采取行动或将其忽略。

每个 DBMP 保存一个向量,记录它从其他每个 DBMP 收到的最后一次修改的时间戳 (T)。

当 DBMP 收到删除修改时,它向所有其他 DBMP 发送一条带时间戳的消息,其中包含它的“最后收到修改的时间戳向量”中最旧的时间戳。每个 DBMP 保存第二个向量,记录从其他每个 DBMP 收到的这类时间戳中最新的那个。

当已删除条目的时间戳 (T) 早于从其他 DBMP 收到的时间戳的这第二个向量中的所有时间戳时,该条目即可从数据库中移除。