mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 09:55:45 +02:00
fix(transaction): Properly store block cancel status (#3371)
This commit is contained in:
parent
37cb247cd4
commit
f73c7d0e42
3 changed files with 8 additions and 3 deletions
|
@ -1178,7 +1178,8 @@ OpStatus Transaction::WaitOnWatch(const time_point& tp, WaitKeysProvider wkeys_p
|
|||
if (status == cv_status::timeout) {
|
||||
result = OpStatus::TIMED_OUT;
|
||||
} else if (coordinator_state_ & COORD_CANCELLED) {
|
||||
result = local_result_;
|
||||
DCHECK_GT(block_cancel_result_, OpStatus::OK);
|
||||
result = block_cancel_result_;
|
||||
}
|
||||
|
||||
// If we don't follow up with an "action" hop, we must clean up manually on all shards.
|
||||
|
@ -1412,7 +1413,8 @@ void Transaction::CancelBlocking(std::function<OpStatus(ArgSlice)> status_cb) {
|
|||
return;
|
||||
|
||||
coordinator_state_ |= COORD_CANCELLED;
|
||||
local_result_ = status;
|
||||
// don't use local_result_ because it can be overwirtten if we cancel ahead
|
||||
block_cancel_result_ = status;
|
||||
blocking_barrier_.Close();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue