Skip to content

Commit

Permalink
modify sharding error log
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyShi22 committed Sep 7, 2023
1 parent 86a2e1d commit c8a5d89
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bcos-executor/src/executor/ShardingTransactionExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void ShardingTransactionExecutor::preExecuteTransactions(int64_t schedulerTermId

if (error)
{
auto errorMessage = "[" + m_name + "] asyncFillBlock failed";
auto errorMessage = "[" + m_name + "] asyncFillBlock failed ";
EXECUTOR_NAME_LOG(ERROR)
<< BLOCK_NUMBER(blockNumber) << errorMessage << error->errorMessage();
callback(BCOS_ERROR_WITH_PREV_UNIQUE_PTR(
Expand Down
8 changes: 4 additions & 4 deletions bcos-scheduler/src/ShardingBlockExecutive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void ShardingBlockExecutive::asyncExecute(
else
{
SCHEDULER_LOG(TRACE) << BLOCK_NUMBER(number()) << LOG_BADGE("BlockTrace")
<< LOG_DESC("DMCExecute begin for call")
<< LOG_DESC("ShardingExecute begin for call")
<< LOG_KV("shardSize", m_dmcExecutors.size());
shardingExecute(std::move(callback));
}
Expand Down Expand Up @@ -181,7 +181,7 @@ void ShardingBlockExecutive::shardingExecute(

if (batchStatus->error > 0)
{
auto message = "DAGExecute:" + boost::lexical_cast<std::string>(number()) +
auto message = "ShardingExecute:" + boost::lexical_cast<std::string>(number()) +
" with errors! " + boost::lexical_cast<std::string>(batchStatus->error);
SCHEDULER_LOG(ERROR) << BLOCK_NUMBER(number()) << message;

Expand All @@ -190,8 +190,8 @@ void ShardingBlockExecutive::shardingExecute(
return;
}

SCHEDULER_LOG(DEBUG) << BLOCK_NUMBER(number()) << LOG_DESC("DAGExecute success")
<< LOG_KV("dagExecuteT", (utcTime() - startT));
SCHEDULER_LOG(DEBUG) << BLOCK_NUMBER(number()) << LOG_DESC("ShardingExecute success")
<< LOG_KV("shardingExecuteT", (utcTime() - startT));

DMCExecute(std::move(callback));
};
Expand Down
11 changes: 6 additions & 5 deletions bcos-scheduler/src/ShardingDmcExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void ShardingDmcExecutor::shardGo(std::function<void(bcos::Error::UniquePtr, Sta
if (!messages)
{
DMC_LOG(DEBUG) << LOG_BADGE("Stat")
<< "DAGExecute:\t --> Send to executor by preExecute cache\t"
<< "ShardingExecute:\t --> Send to executor by preExecute cache\t"
<< LOG_KV("name", m_name) << LOG_KV("shard", m_contractAddress)
<< LOG_KV("txNum", messages ? messages->size() : 0)
<< LOG_KV("blockNumber", m_block && m_block->blockHeader() ?
Expand All @@ -65,7 +65,7 @@ void ShardingDmcExecutor::shardGo(std::function<void(bcos::Error::UniquePtr, Sta
}
else
{
DMC_LOG(DEBUG) << LOG_BADGE("Stat") << "DAGExecute:\t --> Send to executor\t"
DMC_LOG(DEBUG) << LOG_BADGE("Stat") << "ShardingExecute:\t --> Send to executor\t"
<< LOG_KV("name", m_name) << LOG_KV("shard", m_contractAddress)
<< LOG_KV("txNum", messages ? messages->size() : 0)
<< LOG_KV("blockNumber", m_block && m_block->blockHeader() ?
Expand All @@ -80,7 +80,8 @@ void ShardingDmcExecutor::shardGo(std::function<void(bcos::Error::UniquePtr, Sta
bcos::Error::UniquePtr error,
std::vector<bcos::protocol::ExecutionMessage::UniquePtr> outputs) {
// update batch
DMC_LOG(DEBUG) << LOG_BADGE("Stat") << "DAGExecute:\t <-- Receive from executor\t"
DMC_LOG(DEBUG) << LOG_BADGE("Stat")
<< "ShardingExecute:\t <-- Receive from executor\t"
<< LOG_KV("name", m_name) << LOG_KV("shard", m_contractAddress)
<< LOG_KV("txNum", messages ? messages->size() : 0)
<< LOG_KV("blockNumber", m_block && m_block->blockHeader() ?
Expand All @@ -91,7 +92,7 @@ void ShardingDmcExecutor::shardGo(std::function<void(bcos::Error::UniquePtr, Sta
if (error)
{
SCHEDULER_LOG(ERROR)
<< "DAGExecute transaction error: " << error->errorMessage();
<< "ShardingExecute transaction error: " << error->errorMessage();

if (error->errorCode() == bcos::executor::ExecuteError::SCHEDULER_TERM_ID_ERROR)
{
Expand Down Expand Up @@ -131,7 +132,7 @@ void ShardingDmcExecutor::handleShardGoOutput(
dmcMessages.emplace_back(std::move(output));
}
}
DMC_LOG(DEBUG) << LOG_BADGE("Stat") << "DAGExecute: dump output finish";
DMC_LOG(DEBUG) << LOG_BADGE("Stat") << "ShardingExecute: dump output finish";

// going to dmc logic
handleExecutiveOutputs(std::move(dmcMessages));
Expand Down

0 comments on commit c8a5d89

Please sign in to comment.