Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executor: do not track membuffer's memory in executor #53985

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pkg/executor/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,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 exeerrors.ErrBatchInsertFail.GenWithStack("BatchDelete failed with error: %v", err)
}
e.memTracker.Consume(-int64(txn.Size()))
e.Ctx().StmtCommit(ctx)
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 pkg/executor/insert_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,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 exeerrors.ErrBatchInsertFail.GenWithStack("BatchInsert failed with error: %v", err)
}
e.memTracker.Consume(-int64(txn.Size()))
e.Ctx().StmtCommit(ctx)
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 pkg/executor/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,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 @@ -187,7 +186,6 @@ func (e *ReplaceExec) exec(ctx context.Context, newRows [][]types.Datum) error {
return err
}
}
e.memTracker.Consume(int64(txn.Size() - txnSize))
return txn.MayFlush()
}

Expand Down