Strictly serializable datastores greatly simplify the development of correct applications by providing strong consistency guarantees. However, existing techniques pay unnecessary costs for naturally consistent transactions, which arrive at servers in an order that is already strictly serializable. We find these transactions are prevalent in datacenter workloads. We exploit this natural arrival order by executing transaction requests with minimal costs while optimistically assuming they are naturally consistent, and then leverage a timestamp-based technique to efficiently verify if the execution is indeed consistent. In the process of designing such a timestamp-based technique, we identify a fundamental pitfall in relying on timestamps to provide strict serializability, and name it the timestamp-inversion pitfall. We find timestamp-inversion has affected several existing works. We present Natural Concurrency Control (NCC), a new concurrency control technique that guarantees strict serializability and ensures minimal costs -- i.e., one-round latency, lock-free, and non-blocking execution -- in the best (and common) case by leveraging natural consistency. NCC is enabled by three key components: non-blocking execution, decoupled response control, and timestamp-based consistency check. NCC avoids timestamp-inversion with a new technique: response timing control, and proposes two optimization techniques, asynchrony-aware timestamps and smart retry, to reduce false aborts. Moreover, NCC designs a specialized protocol for read-only transactions, which is the first to achieve the optimal best-case performance while ensuring strict serializability, without relying on synchronized clocks. Our evaluation shows that NCC outperforms state-of-the-art solutions by an order of magnitude on many workloads.
翻译:严格可序列化数据存储通过提供强一致性保证,极大简化了正确应用的开发。然而,现有技术对自然一致性事务付出了不必要的代价——这些事务到达服务器的顺序已天然满足严格可序列化性。我们发现这类事务在数据中心工作负载中普遍存在。我们利用这种天然到达顺序,以最小成本执行事务请求,同时乐观假设其具有自然一致性,随后采用基于时间戳的技术高效验证执行是否确实一致。在设计此类时间戳技术的过程中,我们发现了依赖时间戳保证严格可序列化性时的根本性陷阱,并将其命名为时间戳反转陷阱。我们发现时间戳反转已影响多个现有工作。我们提出自然并发控制(NCC)这一新型并发控制技术,通过利用自然一致性,在最佳(常见)情况下即可保证严格可序列化性且实现最小成本——即单轮延迟、无锁及非阻塞执行。NCC由三个关键组件支撑:非阻塞执行、解耦响应控制及基于时间戳的一致性检查。NCC通过新型响应时序控制技术避免时间戳反转,并提出异步感知时间戳与智能重试两种优化技术以减少误中止。此外,NCC为只读事务设计了专用协议,这是首个在不依赖同步时钟前提下实现最优最佳性能并保证严格可序列化性的方案。评估表明,NCC在多种工作负载上的性能比现有最优方案高出一个数量级。