pingcap / pingcap/tidb

The detach of in-memory hashtable after spilling should be gc-aware

Open
#37,530 0 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
https://github.com/pingcap/tidb/blob/a04000cd898001fb7bd44127afa4acddcfce8d27/util/chunk/row_container.go#L114-L144

We'll detach the in-memory hashtable after spilling it to disk in line 143.
. GC may be triggered after a while, thus the memory space can not be freed immediately. In this case, the actual memory usage will exceed `mem_quota_query` a lot when tidb-server starts to cancel this query.

We need to use `Tracker.Release` instead of `Tracker.Consume` in line 143 to make the detaching GC-aware.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.