[fix](load) Fix load channel mgr lock (#13960)

hot fix load channel mgr lock
This commit is contained in:
Xinyi Zou
2022-11-05 00:48:30 +08:00
committed by GitHub
parent a19e6881c7
commit f87be09d69
3 changed files with 7 additions and 2 deletions

View File

@ -404,7 +404,11 @@ Status DeltaWriter::cancel() {
void DeltaWriter::save_mem_consumption_snapshot() {
std::lock_guard<std::mutex> l(_lock);
_mem_consumption_snapshot = mem_consumption();
_memtable_consumption_snapshot = _mem_table->memory_usage();
if (_mem_table == nullptr) {
_memtable_consumption_snapshot = 0;
} else {
_memtable_consumption_snapshot = _mem_table->memory_usage();
}
}
int64_t DeltaWriter::get_memtable_consumption_inflush() const {

View File

@ -61,6 +61,7 @@ public:
void refresh_mem_tracker() {
int64_t mem_usage = 0;
std::lock_guard<std::mutex> l(_lock);
for (auto& kv : _load_channels) {
mem_usage += kv.second->mem_consumption();
}

View File

@ -999,7 +999,6 @@ Status HashJoinNode::prepare(RuntimeState* state) {
"");
_mem_tracker = std::make_unique<MemTracker>("ExecNode:" + _runtime_profile->name(),
_runtime_profile.get());
SCOPED_CONSUME_MEM_TRACKER(mem_tracker());
if (_vconjunct_ctx_ptr) {
RETURN_IF_ERROR((*_vconjunct_ctx_ptr)->prepare(state, _intermediate_row_desc));
@ -1008,6 +1007,7 @@ Status HashJoinNode::prepare(RuntimeState* state) {
for (int i = 0; i < _children.size(); ++i) {
RETURN_IF_ERROR(_children[i]->prepare(state));
}
SCOPED_CONSUME_MEM_TRACKER(mem_tracker());
// Build phase
auto build_phase_profile = runtime_profile()->create_child("BuildPhase", true, true);