From 66d904215b93e45cfedbcdfa336f5825f4807552 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 5 Sep 2024 10:27:21 +0100 Subject: [PATCH] Use async commit and one-phase commit where possible in TiKV (#4701) --- core/src/kvs/tikv/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/kvs/tikv/mod.rs b/core/src/kvs/tikv/mod.rs index 913d52ee..a54bea3c 100644 --- a/core/src/kvs/tikv/mod.rs +++ b/core/src/kvs/tikv/mod.rs @@ -84,6 +84,10 @@ impl Datastore { } else { TransactionOptions::new_optimistic() }; + // Use async commit to determine transaction state earlier + opt = opt.use_async_commit(); + // Try to use one-phase commit if writing to only one region + opt = opt.try_one_pc(); // Set the behaviour when dropping an unfinished transaction opt = opt.drop_check(CheckLevel::Warn); // Set this transaction as read only if possible