Existing algorithms for replicated lists, which are widely used in collaborative text editors, suffer from a problem: when two users concurrently insert text at the same position in the document, the merged outcome may interleave the inserted text passages, resulting in corrupted and potentially unreadable text. The problem has gone unnoticed for decades, and it affects both CRDTs and Operational Transformation. This paper presents Fugue, the first algorithm that guarantees maximal non-interleaving, our new correctness property for replicated lists. We present two variants of the Fugue algorithm, one based on a tree and the other based on a list, and prove that they are semantically equivalent. We also implement Fugue and demonstrate that it offers performance comparable to state-of-the-art CRDT libraries for text editing.
翻译:现有用于复制列表的算法广泛用于协同文本编辑器,但存在一个问题:当两个用户在文档的同一位置同时插入文本时,合并结果可能会交错插入的文本片段,导致文本受损且可能无法阅读。该问题数十年来未被察觉,且同时影响CRDT和操作变换。本文提出Fugue算法,这是首个保证最大非交错性的算法,这是我们为复制列表提出的新正确性属性。我们呈现Fugue算法的两个变体——一个基于树结构,另一个基于列表结构——并证明它们在语义上等价。我们还实现了Fugue,并证明其性能与用于文本编辑的最先进CRDT库相当。