Skip to content

Commit

Permalink
feat(failpoint): control chunk size
Browse files Browse the repository at this point in the history
Signed-off-by: ekexium <[email protected]>
  • Loading branch information
ekexium committed Apr 28, 2024
1 parent 024fdd2 commit e150922
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/executor/internal/exec/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"time"

"github.com/ngaut/pools"
"github.com/pingcap/failpoint"
"github.com/pingcap/tidb/pkg/domain"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/parser"
Expand Down Expand Up @@ -89,6 +90,9 @@ func newExecutorChunkAllocator(vars *variable.SessionVars, retFieldTypes []*type

// InitCap returns the initial capacity for chunk
func (e *executorChunkAllocator) InitCap() int {
failpoint.Inject("initCap", func (val failpoint.Value) {
failpoint.Return(val.(int))
})
return e.initCap
}

Expand All @@ -99,6 +103,9 @@ func (e *executorChunkAllocator) SetInitCap(c int) {

// MaxChunkSize returns the max chunk size.
func (e *executorChunkAllocator) MaxChunkSize() int {
failpoint.Inject("maxChunkSize", func (val failpoint.Value) {
failpoint.Return(val.(int))
})
return e.maxChunkSize
}

Expand Down

0 comments on commit e150922

Please sign in to comment.