Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#54095
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
XuHuaiyu authored and ti-chi-bot committed Jun 27, 2024
1 parent f602ee2 commit 6ce07d4
Show file tree
Hide file tree
Showing 6 changed files with 2,346 additions and 4 deletions.
10 changes: 9 additions & 1 deletion executor/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,17 @@ func (e *IndexLookUpExecutor) open(ctx context.Context) error {
// constructed by a "IndexLookUpJoin" and "Open" will not be called in that
// situation.
e.initRuntimeStats()
<<<<<<< HEAD:executor/distsql.go
e.memTracker = memory.NewTracker(e.id, -1)
e.memTracker.AttachTo(e.ctx.GetSessionVars().StmtCtx.MemTracker)
=======
if e.memTracker != nil {
e.memTracker.Reset()
} else {
e.memTracker = memory.NewTracker(e.ID(), -1)
}
e.memTracker.AttachTo(e.Ctx().GetSessionVars().StmtCtx.MemTracker)
>>>>>>> 374f7b0a5ee (*: support memTracker.detach for HashJoin, Apply and IndexLookUp in Close func (#54095)):pkg/executor/distsql.go

e.finished = make(chan struct{})
e.resultCh = make(chan *lookupTableTask, atomic.LoadInt32(&LookupTableTaskChannelSize))
Expand Down Expand Up @@ -733,7 +742,6 @@ func (e *IndexLookUpExecutor) Close() error {
e.tblWorkerWg.Wait()
e.finished = nil
e.workerStarted = false
e.memTracker = nil
e.resultCurr = nil
return nil
}
Expand Down
Loading

0 comments on commit 6ce07d4

Please sign in to comment.