Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/transaction/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,11 @@ struct Committer<PdC: PdClient = PdRpcClient> {
}

impl<PdC: PdClient> Committer<PdC> {
// CheckNotExists is checked in the prewrite phase and should not appear in the commit phase.
fn filter_out_check_not_exists_mutations(&mut self) {
self.mutations.retain(|m| m.op() != Op::CheckNotExists)
}

async fn commit(mut self) -> Result<Option<Timestamp>> {
debug!("committing");

Expand All @@ -1155,6 +1160,8 @@ impl<PdC: PdClient> Committer<PdC> {
return Ok(min_commit_ts);
}

self.filter_out_check_not_exists_mutations();

let commit_ts = if self.options.async_commit {
// FIXME: min_commit_ts == 0 => fallback to normal 2PC
min_commit_ts.unwrap()
Expand Down