Skip to content

Commit

Permalink
executor: do not track membuffer's memory in executor (#53985) (#55627)
Browse files Browse the repository at this point in the history
close #53984
  • Loading branch information
ti-chi-bot authored Aug 27, 2024
1 parent a1c8a89 commit 14a1cb0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions executor/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ func (e *DeleteExec) deleteSingleTableByChunk(ctx context.Context) error {
}

func (e *DeleteExec) doBatchDelete(ctx context.Context) error {
txn, err := e.ctx.Txn(false)
if err != nil {
return ErrBatchInsertFail.GenWithStack("BatchDelete failed with error: %v", err)
}
e.memTracker.Consume(-int64(txn.Size()))
e.ctx.StmtCommit()
if err := sessiontxn.NewTxnInStmt(ctx, e.ctx); err != nil {
// We should return a special error for batch insert.
Expand Down
5 changes: 0 additions & 5 deletions executor/insert_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,6 @@ func insertRowsFromSelect(ctx context.Context, base insertCommon) error {
}

func (e *InsertValues) doBatchInsert(ctx context.Context) error {
txn, err := e.ctx.Txn(false)
if err != nil {
return ErrBatchInsertFail.GenWithStack("BatchInsert failed with error: %v", err)
}
e.memTracker.Consume(-int64(txn.Size()))
e.ctx.StmtCommit()
if err := sessiontxn.NewTxnInStmt(ctx, e.ctx); err != nil {
// We should return a special error for batch insert.
Expand Down
2 changes: 0 additions & 2 deletions executor/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func (e *ReplaceExec) exec(ctx context.Context, newRows [][]types.Datum) error {
if err != nil {
return err
}
txnSize := txn.Size()

if e.collectRuntimeStatsEnabled() {
if snapshot := txn.GetSnapshot(); snapshot != nil {
Expand All @@ -186,7 +185,6 @@ func (e *ReplaceExec) exec(ctx context.Context, newRows [][]types.Datum) error {
return err
}
}
e.memTracker.Consume(int64(txn.Size() - txnSize))
return nil
}

Expand Down

0 comments on commit 14a1cb0

Please sign in to comment.