Skip to content

Commit

Permalink
do some cleana
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyu85cn committed Dec 1, 2021
1 parent a7d65bb commit 6da5429
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 48 deletions.
5 changes: 1 addition & 4 deletions src/storage/transaction/ChainAddEdgesProcessorRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ namespace nebula {
namespace storage {

void ChainAddEdgesProcessorRemote::process(const cpp2::ChainAddEdgesRequest& req) {
if (FLAGS_trace_toss) {
uuid_ = ConsistUtil::strUUID();
}
// VLOG(1) << uuid_ << ConsistUtil::dumpParts(req.get_parts());
uuid_ = ConsistUtil::strUUID();
auto partId = req.get_parts().begin()->first;
auto code = nebula::cpp2::ErrorCode::SUCCEEDED;
do {
Expand Down
18 changes: 2 additions & 16 deletions src/storage/transaction/ChainDeleteEdgesLocalProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ folly::SemiFuture<Code> ChainDeleteEdgesLocalProcessor::processRemote(Code code)
}

folly::SemiFuture<Code> ChainDeleteEdgesLocalProcessor::processLocal(Code code) {
if (FLAGS_trace_toss) {
VLOG(1) << txnId_ << " processRemote(), code = " << apache::thrift::util::enumNameSafe(code);
}
VLOG(1) << txnId_ << " processRemote(), code = " << apache::thrift::util::enumNameSafe(code);

bool remoteFailed{false};
if (code == Code::SUCCEEDED) {
Expand Down Expand Up @@ -124,7 +122,6 @@ std::vector<kvstore::KV> ChainDeleteEdgesLocalProcessor::makePrime(
std::vector<kvstore::KV> ret;
std::vector<cpp2::DeleteEdgesRequest> requests;

LOG(INFO) << "req.get_parts().size() = " << req.get_parts().size();
for (auto& partOfKeys : req.get_parts()) {
auto partId = partOfKeys.first;
for (auto& key : partOfKeys.second) {
Expand All @@ -137,8 +134,6 @@ std::vector<kvstore::KV> ChainDeleteEdgesLocalProcessor::makePrime(
}
}

LOG(INFO) << "requests.size() = " << requests.size();

for (auto& singleReq : requests) {
std::string val;
apache::thrift::CompactSerializer::serialize(singleReq, &val);
Expand All @@ -158,7 +153,6 @@ Code ChainDeleteEdgesLocalProcessor::checkRequest(const cpp2::DeleteEdgesRequest
req_ = req;
DCHECK(!req_.get_parts().empty());
spaceId_ = req_.get_space_id();
LOG(INFO) << "spaceId_ = " << spaceId_;

auto vidType = env_->metaClient_->getSpaceVidType(spaceId_);
if (!vidType.ok()) {
Expand Down Expand Up @@ -204,9 +198,7 @@ folly::SemiFuture<Code> ChainDeleteEdgesLocalProcessor::commitLocal() {
auto [pro, fut] = folly::makePromiseContract<Code>();
std::move(futProc).thenValue([&, p = std::move(pro)](auto&& resp) mutable {
auto rc = ConsistUtil::getErrorCode(resp);
if (FLAGS_trace_toss) {
LOG(INFO) << txnId_ << " commitLocal() " << apache::thrift::util::enumNameSafe(rc);
}
VLOG(1) << txnId_ << " commitLocal() " << apache::thrift::util::enumNameSafe(rc);
if (rc == Code::SUCCEEDED) {
// do nothing
} else {
Expand Down Expand Up @@ -256,12 +248,6 @@ void ChainDeleteEdgesLocalProcessor::doRpc(folly::Promise<Code>&& promise,
*/
void ChainDeleteEdgesLocalProcessor::hookFunc(HookFuncPara& para) {
std::string ret;
LOG(INFO) << __func__ << "(), primes_.size() = " << primes_.size()
<< ", doublePrimes_.size() = " << doublePrimes_.size();
LOG(INFO) << "primes: ";
for (auto& p : primes_) {
LOG(INFO) << p.first;
}

if (setDoublePrime_) {
if (para.keys) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ folly::SemiFuture<Code> ChainDeleteEdgesResumeProcessor::processLocal(Code code)
if (code == Code::E_RPC_FAILURE || code == Code::SUCCEEDED) {
// if there are something wrong other than rpc failure
// we need to keep the resume retry(by not remove those prime key)
// erasePrime();
code_ = commitLocal().get();
return code_;
}
Expand Down
14 changes: 4 additions & 10 deletions src/storage/transaction/ChainDeleteEdgesResumeRemoteProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ ChainDeleteEdgesResumeRemoteProcessor::ChainDeleteEdgesResumeRemoteProcessor(Sto
const std::string& val)
: ChainDeleteEdgesLocalProcessor(env) {
req_ = DeleteEdgesRequestHelper::parseDeleteEdgesRequest(val);

if (FLAGS_trace_toss) {
LOG(INFO) << txnId_ << " resume prime " << readableEdgeDesc_;
}
}

folly::SemiFuture<nebula::cpp2::ErrorCode> ChainDeleteEdgesResumeRemoteProcessor::prepareLocal() {
Expand All @@ -27,16 +23,14 @@ folly::SemiFuture<nebula::cpp2::ErrorCode> ChainDeleteEdgesResumeRemoteProcessor
}

folly::SemiFuture<Code> ChainDeleteEdgesResumeRemoteProcessor::processRemote(Code code) {
if (FLAGS_trace_toss) {
LOG(INFO) << txnId_ << " prepareLocal() " << apache::thrift::util::enumNameSafe(code);
}
VLOG(1) << txnId_ << " prepareLocal() " << apache::thrift::util::enumNameSafe(code);

return ChainDeleteEdgesLocalProcessor::processRemote(code);
}

folly::SemiFuture<Code> ChainDeleteEdgesResumeRemoteProcessor::processLocal(Code code) {
if (FLAGS_trace_toss) {
LOG(INFO) << txnId_ << " processRemote() " << apache::thrift::util::enumNameSafe(code);
}
VLOG(1) << txnId_ << " processRemote() " << apache::thrift::util::enumNameSafe(code);

setErrorCode(code);

if (code == Code::E_RPC_FAILURE) {
Expand Down
2 changes: 0 additions & 2 deletions src/storage/transaction/ChainUpdateEdgeProcessorLocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ class ChainUpdateEdgeProcessorLocal

bool checkTerm();

// bool checkVersion();

folly::SemiFuture<Code> processNormalLocal(Code code);

void abort();
Expand Down
10 changes: 0 additions & 10 deletions src/storage/transaction/ResumeAddEdgeRemoteProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ folly::SemiFuture<nebula::cpp2::ErrorCode> ResumeAddEdgeRemoteProcessor::prepare
return Code::E_OUTDATED_TERM;
}

// if (!checkVersion(req_)) {
// LOG(WARNING) << this << "E_OUTDATED_EDGE";
// return Code::E_OUTDATED_EDGE;
// }

auto spaceId = req_.get_space_id();
auto numOfPart = env_->metaClient_->partsNum(spaceId);
if (!numOfPart.ok()) {
Expand All @@ -47,11 +42,6 @@ folly::SemiFuture<Code> ResumeAddEdgeRemoteProcessor::processLocal(Code code) {
return Code::E_OUTDATED_TERM;
}

// if (!checkVersion(req_)) {
// LOG(WARNING) << this << "E_OUTDATED_EDGE";
// return Code::E_OUTDATED_EDGE;
// }

if (code == Code::E_OUTDATED_TERM) {
// E_OUTDATED_TERM indicate this host is no longer the leader of curr part
// any following kv operation will fail
Expand Down
5 changes: 0 additions & 5 deletions src/storage/transaction/ResumeUpdateProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ folly::SemiFuture<Code> ResumeUpdateProcessor::processLocal(Code code) {
return Code::E_OUTDATED_TERM;
}

// if (!checkVersion()) {
// LOG(WARNING) << "E_OUTDATED_EDGE";
// return Code::E_OUTDATED_EDGE;
// }

if (code == Code::E_RPC_FAILURE) {
appendDoublePrime();
}
Expand Down

0 comments on commit 6da5429

Please sign in to comment.