You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/02/18 09:16:58 UTC
[doris] 01/02: add more logs to buffer control block
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch sanqi
in repository https://gitbox.apache.org/repos/asf/doris.git
commit d7f9288617aae988f2cbaeb906d064aaf5fb481f
Author: yiguolei <yi...@gmail.com>
AuthorDate: Sat Feb 18 16:44:41 2023 +0800
add more logs to buffer control block
---
be/src/runtime/buffer_control_block.cpp | 5 ++++-
be/src/runtime/result_buffer_mgr.cpp | 6 ++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/be/src/runtime/buffer_control_block.cpp b/be/src/runtime/buffer_control_block.cpp
index 03bd6d3466..b516e3ae9f 100644
--- a/be/src/runtime/buffer_control_block.cpp
+++ b/be/src/runtime/buffer_control_block.cpp
@@ -113,10 +113,12 @@ Status BufferControlBlock::add_batch(std::unique_ptr<TFetchDataResult>& result)
}
if (_waiting_rpc.empty()) {
+ LOG(INFO) << "wait rpc is empty add to queue";
_buffer_rows += num_rows;
_batch_queue.push_back(std::move(result));
_data_arrival.notify_one();
} else {
+ LOG(INFO) << "wait rpc is not empty, call ctx directly";
auto ctx = _waiting_rpc.front();
_waiting_rpc.pop_front();
ctx->on_data(result, _packet_num);
@@ -180,7 +182,7 @@ void BufferControlBlock::get_batch(GetResultBatchCtx* ctx) {
_batch_queue.pop_front();
_buffer_rows -= result->result_batch.rows.size();
_data_removal.notify_one();
-
+ LOG(INFO) << "find data return";
ctx->on_data(result, _packet_num);
_packet_num++;
return;
@@ -189,6 +191,7 @@ void BufferControlBlock::get_batch(GetResultBatchCtx* ctx) {
ctx->on_close(_packet_num, _query_statistics.get());
return;
}
+ LOG(INFO) << "not data wait";
// no ready data, push ctx to waiting list
_waiting_rpc.push_back(ctx);
}
diff --git a/be/src/runtime/result_buffer_mgr.cpp b/be/src/runtime/result_buffer_mgr.cpp
index b9d6cc7234..6f5fe451fd 100644
--- a/be/src/runtime/result_buffer_mgr.cpp
+++ b/be/src/runtime/result_buffer_mgr.cpp
@@ -60,6 +60,7 @@ Status ResultBufferMgr::init() {
Status ResultBufferMgr::create_sender(const TUniqueId& query_id, int buffer_size,
std::shared_ptr<BufferControlBlock>* sender,
int query_timeout) {
+ LOG(INFO) << "create sender for query " << query_id;
*sender = find_control_block(query_id);
if (*sender != nullptr) {
LOG(WARNING) << "already have buffer control block for this instance " << query_id;
@@ -91,7 +92,7 @@ std::shared_ptr<BufferControlBlock> ResultBufferMgr::find_control_block(const TU
if (_buffer_map.end() != iter) {
return iter->second;
}
-
+ LOG(INFO) << "could not find control block for query " << query_id;
return std::shared_ptr<BufferControlBlock>();
}
@@ -116,13 +117,14 @@ void ResultBufferMgr::fetch_data(const PUniqueId& finst_id, GetResultBatchCtx* c
ctx->on_failure(Status::InternalError("no result for this query"));
return;
}
+ LOG(INFO) << "try to get batch for " << tid;
cb->get_batch(ctx);
}
Status ResultBufferMgr::cancel(const TUniqueId& query_id) {
std::lock_guard<std::mutex> l(_lock);
BufferMap::iterator iter = _buffer_map.find(query_id);
-
+ LOG(INFO) << "begin to cancel query " << query_id;
if (_buffer_map.end() != iter) {
iter->second->cancel();
_buffer_map.erase(iter);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org