Skip to content

Commit 2a0d7b8

Browse files
authored
executor: do not track membuffer's memory in executor (#53985) (#55037)
close #53984
1 parent 7a8023e commit 2a0d7b8

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

pkg/executor/delete.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ func (e *DeleteExec) deleteSingleTableByChunk(ctx context.Context) error {
155155
}
156156

157157
func (e *DeleteExec) doBatchDelete(ctx context.Context) error {
158-
txn, err := e.Ctx().Txn(false)
159-
if err != nil {
160-
return exeerrors.ErrBatchInsertFail.GenWithStack("BatchDelete failed with error: %v", err)
161-
}
162-
e.memTracker.Consume(-int64(txn.Size()))
163158
e.Ctx().StmtCommit(ctx)
164159
if err := sessiontxn.NewTxnInStmt(ctx, e.Ctx()); err != nil {
165160
// We should return a special error for batch insert.

pkg/executor/insert_common.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,6 @@ func insertRowsFromSelect(ctx context.Context, base insertCommon) error {
522522
}
523523

524524
func (e *InsertValues) doBatchInsert(ctx context.Context) error {
525-
txn, err := e.Ctx().Txn(false)
526-
if err != nil {
527-
return exeerrors.ErrBatchInsertFail.GenWithStack("BatchInsert failed with error: %v", err)
528-
}
529-
e.memTracker.Consume(-int64(txn.Size()))
530525
e.Ctx().StmtCommit(ctx)
531526
if err := sessiontxn.NewTxnInStmt(ctx, e.Ctx()); err != nil {
532527
// We should return a special error for batch insert.

pkg/executor/replace.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ func (e *ReplaceExec) exec(ctx context.Context, newRows [][]types.Datum) error {
161161
if err != nil {
162162
return err
163163
}
164-
txnSize := txn.Size()
165164

166165
if e.collectRuntimeStatsEnabled() {
167166
if snapshot := txn.GetSnapshot(); snapshot != nil {
@@ -187,7 +186,6 @@ func (e *ReplaceExec) exec(ctx context.Context, newRows [][]types.Datum) error {
187186
return err
188187
}
189188
}
190-
e.memTracker.Consume(int64(txn.Size() - txnSize))
191189
return txn.MayFlush()
192190
}
193191

0 commit comments

Comments
 (0)