Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Nov 16, 2022
1 parent a6a5053 commit 31627fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ddl/backfilling.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ func (dc *ddlCtx) writePhysicalTableRecord(sessPool *sessionPool, t table.Physic

if len(remains) == 0 {
if ingestBeCtx != nil {
ingestBeCtx.EngMgr.ResetWorkers(job.ID, reorgInfo.currElement.ID)
ingestBeCtx.EngMgr.ResetWorkers(ingestBeCtx, job.ID, reorgInfo.currElement.ID)
}
break
}
Expand Down
4 changes: 3 additions & 1 deletion ddl/ingest/engine_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,15 @@ func (m *engineManager) Unregister(jobID, indexID int64) {

// ResetWorkers reset the writer count of the engineInfo because
// the goroutines of backfill workers have been terminated.
func (m *engineManager) ResetWorkers(jobID, indexID int64) {
func (m *engineManager) ResetWorkers(bc *BackendContext, jobID, indexID int64) {
ei, exist := m.Load(indexID)
if !exist {
return
}
m.MemRoot.Release(StructSizeWriterCtx * int64(ei.writerCount))
m.MemRoot.ReleaseWithTag(encodeEngineTag(jobID, indexID))
engineCacheSize := int64(bc.cfg.TikvImporter.EngineMemCacheSize)
m.MemRoot.ConsumeWithTag(encodeEngineTag(jobID, indexID), engineCacheSize)
ei.writerCount = 0
}

Expand Down

0 comments on commit 31627fe

Please sign in to comment.