From af408c99ab05a97249d25bb47e872e74dc604558 Mon Sep 17 00:00:00 2001 From: Shenghui Wu <793703860@qq.com> Date: Mon, 25 May 2020 23:23:18 +0800 Subject: [PATCH] executor: add an option and close sort-spill-disk by defaults. (#17384) * add comments * fix * fix --- executor/executor_pkg_test.go | 1 + executor/sort.go | 5 +++-- executor/sort_test.go | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/executor/executor_pkg_test.go b/executor/executor_pkg_test.go index e9bb78c2691f2..8f2148ab2c086 100644 --- a/executor/executor_pkg_test.go +++ b/executor/executor_pkg_test.go @@ -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 diff --git a/executor/sort.go b/executor/sort.go index ff67fa61a370f..d5f85fc9c42fe 100644 --- a/executor/sort.go +++ b/executor/sort.go @@ -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) { @@ -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) diff --git a/executor/sort_test.go b/executor/sort_test.go index ffbe438da9e7d..8a531a72e23b8 100644 --- a/executor/sort_test.go +++ b/executor/sort_test.go @@ -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