Conflict-Free Replicated Data Types (CRDTs) are used in a range of fields for their coordination-free replication with strong eventual consistency. By prioritising availability over consistency under partition, peers accumulate events in different orders, and rely on an associative, commutative and idempotent merge function to present a materialised view of the CRDT. Under some circumstances, the state of the materialised view over time can appear to ''roll back'' previously applied events. When the materialised view is used to manage group permissions such as ones found in instant messaging applications, this can lead to surprising behaviour. Rollbacks can occur when there are multiple concurrent events, such as in the Duelling Admins problem where two equally permissioned admins concurrently revoke each other's permissions. Who wins? Different solutions and their trade-offs are examined. A Byzantine admin can exploit concurrency to influence the duel, whereby we argue that an external arbiter is required to order concurrent events. Our ERA proposal arbitrates asynchronously in batches via optional ''epoch events'', preserving availability. This introduces a bounded total order within epochs, and the resulting ''finality'' improves on the level of consistency CRDTs can provide.
翻译:无冲突复制数据类型(CRDTs)凭借其无需协调的复制与强最终一致性,被广泛应用于多个领域。在分区场景下,由于优先保证可用性而非一致性,各节点以不同顺序累积事件,并依赖满足结合律、交换律与幂等性的合并函数呈现CRDT的物化视图。在某些情况下,物化视图随时间推移的状态可能呈现先前应用事件的"回滚"。当物化视图用于管理如即时通讯应用中的群组权限时,这可能导致异常行为。当存在多个并发事件时(例如在"决斗管理员"问题中,两名权限对等的管理员同时撤销对方权限),回滚即会发生。究竟谁能胜出?本文分析了不同解决方案及其权衡取舍。恶意管理员可利用并发性影响决斗结果,我们据此论证需要外部仲裁者对并发事件排序。我们提出的ERA方案通过可选的"时期事件"以异步批次方式进行仲裁,保障可用性。该方案在时期内引入有界全序关系,由此产生的"最终性"提升了CRDT可提供的最终一致性水平。