Skip to content

Commit

Permalink
no need to setAutoUnlock true
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyu85cn committed Jan 17, 2022
1 parent 5d81305 commit 5016ce1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/clients/storage/InternalStorageClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ::nebula::cpp2::ErrorCode getErrorCode(T& tryResp) {
switch (stResp.status().code()) {
case Status::Code::kLeaderChanged:
return nebula::cpp2::ErrorCode::E_LEADER_CHANGED;
case Status::Code::kError:
return nebula::cpp2::ErrorCode::E_RPC_FAILURE;
default:
LOG(ERROR) << "not impl error transform: code="
<< static_cast<int32_t>(stResp.status().code());
Expand Down Expand Up @@ -70,7 +72,6 @@ void InternalStorageClient::chainUpdateEdge(cpp2::UpdateEdgeRequest& reversedReq
std::move(resp).thenTry([=, p = std::move(p)](auto&& t) mutable {
auto code = getErrorCode(t);
VLOG(1) << "chainUpdateEdge rpc: " << apache::thrift::util::enumNameSafe(code);
;
if (code == ::nebula::cpp2::ErrorCode::E_LEADER_CHANGED) {
chainUpdateEdge(reversedRequest, termOfSrc, optVersion, std::move(p));
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/storage/transaction/ChainAddEdgesLocalProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void ChainAddEdgesLocalProcessor::finish() {
} else if (rcRemote_ == Code::E_RPC_FAILURE) {
reportFailed(ResumeType::RESUME_REMOTE);
} else {
lk_->setAutoUnlock(true);
// lk_->setAutoUnlock(true);
}
} else {
// transaction manager will do the clean.
Expand Down
2 changes: 1 addition & 1 deletion src/storage/transaction/ChainDeleteEdgesLocalProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void ChainDeleteEdgesLocalProcessor::finish() {
} else if (rcRemote_ == Code::E_RPC_FAILURE) {
reportFailed(ResumeType::RESUME_REMOTE);
} else {
lk_->setAutoUnlock(true);
// lk_->setAutoUnlock(true);
}
} else {
// transaction manager will do the clean.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ folly::SemiFuture<Code> ChainResumeUpdatePrimeProcessor::processRemote(Code code

folly::SemiFuture<Code> ChainResumeUpdatePrimeProcessor::processLocal(Code code) {
VLOG(1) << "processRemote()=" << apache::thrift::util::enumNameSafe(code);
rcRemote_ = code;
setErrorCode(code);

auto currTerm = env_->txnMan_->getTermFromKVStore(spaceId_, localPartId_);
Expand Down
4 changes: 2 additions & 2 deletions src/storage/transaction/ChainUpdateEdgeLocalProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void ChainUpdateEdgeLocalProcessor::finish() {
std::tie(currTerm, std::ignore) = env_->txnMan_->getTermFromKVStore(spaceId_, localPartId_);
if (term_ == currTerm) {
if (rcCommit_ == Code::SUCCEEDED && rcRemote_ == Code::SUCCEEDED) {
lk_->setAutoUnlock(true);
// lk_->setAutoUnlock(true);
} else if (isKVStoreError(rcCommit_)) {
reportFailed(ResumeType::RESUME_CHAIN);
} else if (rcRemote_ == Code::E_RPC_FAILURE) {
Expand All @@ -133,7 +133,7 @@ void ChainUpdateEdgeLocalProcessor::finish() {
// 2. rcRemote_ has some error other than RPC_FAILURE
// 2.1 we should do abort if this.
// 2.2 abort() should only have kv store error
lk_->setAutoUnlock(true);
// lk_->setAutoUnlock(true);
}
} else {
// if term changed, transaction manager will do the clean.
Expand Down

0 comments on commit 5016ce1

Please sign in to comment.