Skip to content

Commit

Permalink
Merge pull request #1 from windtalker/refine_log_v65x
Browse files Browse the repository at this point in the history
add more log
  • Loading branch information
xzhangxian1008 authored Dec 25, 2023
2 parents ea1f5ec + 898dd8b commit 1e85ef2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
4 changes: 3 additions & 1 deletion dbms/src/Flash/Coprocessor/DAGStorageInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,10 +1003,12 @@ std::unordered_map<TableID, DAGStorageInterpreter::StorageWithStructureLock> DAG
else
/// If first try failed, sync schema and try again.
{
LOG_DEBUG(log, "not OK, syncing schemas.");
LOG_INFO(log, "not OK, syncing schemas.");

sync_schema();

LOG_INFO(log, "syncing schemas done.");

std::tie(storages, locks, storage_schema_versions, ok) = get_and_lock_storages(true);
if (ok)
{
Expand Down
8 changes: 7 additions & 1 deletion dbms/src/Flash/EstablishCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,13 @@ void EstablishCallData::writeDone(String msg, const grpc::Status & status)

if (async_tunnel_sender)
{
LOG_INFO(async_tunnel_sender->getLogger(), "connection for {} cost {} ms, including {} ms to waiting task.", async_tunnel_sender->getTunnelId(), stopwatch->elapsedMilliseconds(), waiting_task_time_ms);
auto time = stopwatch->elapsedMilliseconds();
LOG_IMPL(async_tunnel_sender->getLogger(),
msg.empty() && time < 1000 ? Poco::Message::PRIO_DEBUG : Poco::Message::PRIO_INFORMATION,
"connection for {} cost {} ms, including {} ms to waiting task.",
async_tunnel_sender->getTunnelId(),
time,
waiting_task_time_ms);

RUNTIME_ASSERT(!async_tunnel_sender->isConsumerFinished(), async_tunnel_sender->getLogger(), "tunnel {} consumer finished in advance", async_tunnel_sender->getTunnelId());

Expand Down
6 changes: 3 additions & 3 deletions dbms/src/Flash/FlashService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ grpc::Status FlashService::Coprocessor(
CPUAffinityManager::getInstance().bindSelfGrpcThread();
bool is_remote_read = getClientMetaVarWithDefault(grpc_context, "is_remote_read", "") == "true";
auto log_level = is_remote_read ? Poco::Message::PRIO_INFORMATION : Poco::Message::PRIO_DEBUG;
LOG_IMPL(log, log_level, "Handling coprocessor request, is_remote_read: {}, start ts: {}, region info: {}, region epoch: {}", is_remote_read, request->start_ts(), request->context().region_id(), request->context().region_epoch().DebugString());
LOG_IMPL(log, log_level, "Handling coprocessor request, is_remote_read: {}, start ts: {}, region id: {}, region epoch: {}", is_remote_read, request->start_ts(), request->context().region_id(), request->context().region_epoch().DebugString());

auto check_result = checkGrpcContext(grpc_context);
if (!check_result.ok())
Expand Down Expand Up @@ -165,10 +165,10 @@ grpc::Status FlashService::Coprocessor(
return grpc::Status::OK;
}
}

if (wait_ms > 1000)
log_level = Poco::Message::PRIO_INFORMATION;
LOG_IMPL(log, log_level, "Begin process cop request after wait {} ms, start ts: {}, region info: {}, region epoch: {}", wait_ms, request->start_ts(), request->context().region_id(), request->context().region_epoch().DebugString());
LOG_IMPL(log, log_level, "Begin process cop request after wait {} ms, start ts: {}, region id: {}, region epoch: {}", wait_ms, request->start_ts(), request->context().region_id(), request->context().region_epoch().DebugString());

auto [db_context, status] = createDBContext(grpc_context);
if (!status.ok())
Expand Down
5 changes: 4 additions & 1 deletion dbms/src/Flash/Mpp/MPPTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ void MPPTask::runImpl()
mpp_task_statistics.start();

auto result = query_executor_holder->execute();
LOG_INFO(log, "mpp task finish execute, success: {}", result.is_success);
auto log_level = Poco::Message::PRIO_DEBUG;
if (!result.is_success || status != RUNNING)
log_level = Poco::Message::PRIO_INFORMATION;
LOG_IMPL(log, log_level, "mpp task finish execute, success: {}, status: {}", result.is_success, magic_enum::enum_name(status.load()));
if (likely(result.is_success))
{
// finish receiver
Expand Down
4 changes: 3 additions & 1 deletion dbms/src/Flash/Mpp/MPPTaskStatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ const BaseRuntimeStatistics & MPPTaskStatistics::collectRuntimeStatistics()

void MPPTaskStatistics::logTracingJson()
{
LOG_INFO(
LOG_IMPL(
logger,
/// don't use info log for initializing status since it does not contains too many information
status == INITIALIZING ? Poco::Message::PRIO_DEBUG : Poco::Message::PRIO_INFORMATION,
R"({{"query_tso":{},"task_id":{},"is_root":{},"sender_executor_id":"{}","executors":{},"host":"{}")"
R"(,"task_init_timestamp":{},"task_start_timestamp":{},"task_end_timestamp":{})"
R"(,"compile_start_timestamp":{},"compile_end_timestamp":{})"
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Interpreters/executeQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void logQueryPipeline(const LoggerPtr & logger, const BlockInputStreamPtr & in)
in->dumpTree(log_buffer);
return log_buffer.toString();
};
LOG_DEBUG(logger, pipeline_log_str());
LOG_INFO(logger, pipeline_log_str());
}

BlockIO executeQuery(
Expand Down

0 comments on commit 1e85ef2

Please sign in to comment.