Skip to content

Commit

Permalink
executor: add an option and close sort-spill-disk by defaults. (#17384)
Browse files Browse the repository at this point in the history
* add comments

* fix

* fix
  • Loading branch information
wshwsh12 authored May 25, 2020
1 parent 8ab4555 commit af408c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions executor/executor_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func assertEqualStrings(c *C, got []field, expect []string) {
}

func (s *testExecSerialSuite) TestSortSpillDisk(c *C) {
c.Skip("Close the feature temporarily.")
originCfg := config.GetGlobalConfig()
newConf := *originCfg
newConf.OOMUseTmpStorage = true
Expand Down
5 changes: 3 additions & 2 deletions executor/sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ func (e *SortExec) fetchRowChunks(ctx context.Context) error {
e.rowChunks.GetMemTracker().AttachTo(e.memTracker)
e.rowChunks.GetMemTracker().SetLabel(rowChunksLabel)
var onExceededCallback func(rowContainer *chunk.RowContainer)
if config.GetGlobalConfig().OOMUseTmpStorage {
var openSortSpillDisk = false
if openSortSpillDisk && config.GetGlobalConfig().OOMUseTmpStorage {
e.spillAction = e.rowChunks.ActionSpill()
e.ctx.GetSessionVars().StmtCtx.MemTracker.FallbackOldAndSetNewAction(e.spillAction)
onExceededCallback = func(rowContainer *chunk.RowContainer) {
Expand All @@ -266,7 +267,7 @@ func (e *SortExec) fetchRowChunks(ctx context.Context) error {
if err := e.rowChunks.Add(chk); err != nil {
return err
}
if e.rowChunks.AlreadySpilled() {
if openSortSpillDisk && e.rowChunks.AlreadySpilled() {
e.rowChunks = chunk.NewRowContainer(retTypes(e), e.maxChunkSize)
e.rowChunks.GetMemTracker().AttachTo(e.memTracker)
e.rowChunks.GetMemTracker().SetLabel(rowChunksLabel)
Expand Down
1 change: 1 addition & 0 deletions executor/sort_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
)

func (s *testSuite) TestSortInDisk(c *C) {
c.Skip("Close the feature temporarily.")
originCfg := config.GetGlobalConfig()
newConf := *originCfg
newConf.OOMUseTmpStorage = true
Expand Down

0 comments on commit af408c9

Please sign in to comment.