Skip to content

Commit

Permalink
sender log
Browse files Browse the repository at this point in the history
Signed-off-by: guo-shaoge <[email protected]>
  • Loading branch information
guo-shaoge committed Oct 19, 2024
1 parent dbd6afe commit 8faaf5a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions dbms/src/Common/LooseBoundedMPMCQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,20 @@ class LooseBoundedMPMCQueue
, push_callback(std::move(push_callback_))
{}

String getAddr() const
{
std::stringstream ss;
ss << this;
return ss.str();
}

void registerPipeReadTask(TaskPtr && task)
{
{
const auto pipe_task_cnt = pipe_reader_cv.getTaskCnt();
std::lock_guard lock(mu);
LOG_DEBUG(Logger::get(), "gjt debug registerPipeReadTask queue size: {}, status: {}, pipe_task_cnt: {}, workqueue: {}",
queue.size(), status == MPMCQueueStatus::NORMAL, pipe_task_cnt, getAddr());
if (queue.empty() && status == MPMCQueueStatus::NORMAL)
{
pipe_reader_cv.registerTask(std::move(task));
Expand All @@ -66,7 +76,10 @@ class LooseBoundedMPMCQueue
void registerPipeWriteTask(TaskPtr && task)
{
{
const auto pipe_task_cnt = pipe_writer_cv.getTaskCnt();
std::lock_guard lock(mu);
LOG_DEBUG(Logger::get(), "gjt debug registerPipeWriteTask isFullWithoutLock: {}, status: {}, pipe_task_cnt: {}, workqueue: {}",
isFullWithoutLock(), status == MPMCQueueStatus::NORMAL, pipe_task_cnt, getAddr());
if (isFullWithoutLock() && status == MPMCQueueStatus::NORMAL)
{
pipe_writer_cv.registerTask(std::move(task));
Expand Down Expand Up @@ -259,18 +272,24 @@ class LooseBoundedMPMCQueue
private:
void notifyOneReader()
{
LOG_DEBUG(Logger::get(), "gjt debug notifyOneReader: {}",
getAddr());
reader_cv.notify_one();
pipe_reader_cv.notifyOne();
}

void notifyOneWriter()
{
LOG_DEBUG(Logger::get(), "gjt debug notifyOneWriter: {}",
getAddr());
writer_cv.notify_one();
pipe_writer_cv.notifyOne();
}

void notifyAll()
{
LOG_DEBUG(Logger::get(), "gjt debug notifyAll: {}",
getAddr());
reader_cv.notify_all();
pipe_reader_cv.notifyAll();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ bool SegmentReadTaskScheduler::needScheduleToRead(const SegmentReadTaskPoolPtr &
{
if (pool->getFreeBlockSlots() <= 0)
{
LOG_DEBUG(Logger::get(), "gjt debug needScheduleToRead failed: {}", pool->getFreeBlockSlotsInfo());
// LOG_DEBUG(Logger::get(), "gjt debug needScheduleToRead failed: {}", pool->getFreeBlockSlotsInfo());
GET_METRIC(tiflash_storage_read_thread_counter, type_sche_no_slot).Increment();
return false;
}
Expand Down

0 comments on commit 8faaf5a

Please sign in to comment.