diff --git a/dbms/src/Storages/KVStore/Read/ReadIndexDataNode.cpp b/dbms/src/Storages/KVStore/Read/ReadIndexDataNode.cpp index 7d5211b9745..f141ec9b28e 100644 --- a/dbms/src/Storages/KVStore/Read/ReadIndexDataNode.cpp +++ b/dbms/src/Storages/KVStore/Read/ReadIndexDataNode.cpp @@ -82,7 +82,7 @@ void ReadIndexDataNode::runOneRound(const TiFlashRaftProxyHelper & helper, const e.second->update(history_success_tasks->second); } - LOG_TRACE( + LOG_DEBUG( DB::Logger::get(), "[Learner Read] Read Index in Batch(use histroy), max_ts={} region_id={} waiting_tasks={} " "running_tasks={} histroy_ts={}", @@ -123,7 +123,7 @@ void ReadIndexDataNode::runOneRound(const TiFlashRaftProxyHelper & helper, const } } - LOG_TRACE( + LOG_DEBUG( DB::Logger::get(), "[Learner Read] Read Index in Batch(new request), max_ts={} region_id={} waiting_tasks={} " "running_tasks={} should_build_running_task={} build_success={}", @@ -253,6 +253,7 @@ void ReadIndexDataNode::doAddHistoryTasks(Timestamp ts, kvrpcpb::ReadIndexRespon } } { + LOG_DEBUG(DB::Logger::get(), "[Learner Read] Add histroy tasks ts={} region_id={}", ts, region_id); history_success_tasks.emplace(ts, std::move(resp)); // move resp } } diff --git a/dbms/src/Storages/RegionQueryInfo.h b/dbms/src/Storages/RegionQueryInfo.h index 66f74f38d71..db527bee2b3 100644 --- a/dbms/src/Storages/RegionQueryInfo.h +++ b/dbms/src/Storages/RegionQueryInfo.h @@ -72,14 +72,26 @@ struct MvccQueryInfo // A cache for Region -> read index result between retries using ReadIndexRes = std::unordered_map; - ReadIndexRes read_index_res_cache; DM::ScanContextPtr scan_context; +private: + ReadIndexRes read_index_res_cache; + public: explicit MvccQueryInfo(bool resolve_locks_ = false, UInt64 start_ts_ = 0, DM::ScanContextPtr scan_ctx = nullptr); - void addReadIndexResToCache(RegionID region_id, UInt64 read_index) { read_index_res_cache[region_id] = read_index; } + void addReadIndexResToCache(RegionID region_id, UInt64 read_index) + { + LOG_DEBUG( + DB::Logger::get(), + "addReadIndexResToCache region_id={} read_index={} start_ts={}", + region_id, + read_index, + start_ts); + read_index_res_cache[region_id] = read_index; + } + UInt64 getReadIndexRes(RegionID region_id) const { if (auto it = read_index_res_cache.find(region_id); it != read_index_res_cache.end())