Use async commit and one-phase commit where possible in TiKV (#4701)

This commit is contained in:
Tobie Morgan Hitchcock 2024-09-05 10:27:21 +01:00 committed by GitHub
parent a94d356017
commit 66d904215b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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