Commit 211088df authored by Cheng Chang's avatar Cheng Chang Committed by Facebook GitHub Bot
Browse files

Remove redundant update of txn_state_ in transaction Prepare (#6778)

When  expiration is set in a pessimistic transaction, `txn_state_` is already updated to `AWAITING_PREPARE` in the `if (expiration_time_ > 0)` block, there is  no need to update the state in `if (can_prepare)` block again.
Pull Request resolved:

Test Plan: make check

Reviewed By: lth

Differential Revision: D21335319

Pulled By: cheng-chang

fbshipit-source-id: 251d634cc7d1a0e86e673a59f0bda8584da5a35f
parent c8643edf
......@@ -191,11 +191,11 @@ Status PessimisticTransaction::Prepare() {
} else if (txn_state_ == STARTED) {
// expiration and lock stealing is not possible;
can_prepare = true;
if (can_prepare) {;
// transaction can't expire after preparation
expiration_time_ = 0;
assert(log_number_ == 0 ||
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment