@@ -81,20 +81,30 @@ const (
81
81
// 0 means no limit
82
82
unlimitedWriteSpeed = config .ByteSize (0 )
83
83
84
- characterSetOption = "character_set"
85
- fieldsTerminatedByOption = "fields_terminated_by"
86
- fieldsEnclosedByOption = "fields_enclosed_by"
87
- fieldsEscapedByOption = "fields_escaped_by"
88
- fieldsDefinedNullByOption = "fields_defined_null_by"
89
- linesTerminatedByOption = "lines_terminated_by"
90
- skipRowsOption = "skip_rows"
91
- splitFileOption = "split_file"
92
- diskQuotaOption = "disk_quota"
93
- threadOption = "thread"
94
- maxWriteSpeedOption = "max_write_speed"
95
- checksumTableOption = "checksum_table"
96
- recordErrorsOption = "record_errors"
97
- detachedOption = "detached"
84
+ characterSetOption = "character_set"
85
+ fieldsTerminatedByOption = "fields_terminated_by"
86
+ fieldsEnclosedByOption = "fields_enclosed_by"
87
+ fieldsEscapedByOption = "fields_escaped_by"
88
+ fieldsDefinedNullByOption = "fields_defined_null_by"
89
+ linesTerminatedByOption = "lines_terminated_by"
90
+ skipRowsOption = "skip_rows"
91
+ splitFileOption = "split_file"
92
+ diskQuotaOption = "disk_quota"
93
+ threadOption = "thread"
94
+ maxWriteSpeedOption = "max_write_speed"
95
+ checksumTableOption = "checksum_table"
96
+ recordErrorsOption = "record_errors"
97
+ detachedOption = "detached"
98
+ // if 'import mode' enabled, TiKV will:
99
+ // - set level0_stop_writes_trigger = max(old, 1 << 30)
100
+ // - set level0_slowdown_writes_trigger = max(old, 1 << 30)
101
+ // - set soft_pending_compaction_bytes_limit = 0,
102
+ // - set hard_pending_compaction_bytes_limit = 0,
103
+ // - will not trigger flow control when SST count in L0 is large
104
+ // - will not trigger region split, it might cause some region became
105
+ // very large and be a hotspot, might cause latency spike.
106
+ //
107
+ // default false for local sort, true for global sort.
98
108
disableTiKVImportModeOption = "disable_tikv_import_mode"
99
109
cloudStorageURIOption = "cloud_storage_uri"
100
110
disablePrecheckOption = "disable_precheck"
@@ -782,6 +792,9 @@ func (p *Plan) adjustOptions(targetNodeCPUCnt int) {
782
792
zap .Int ("before" , p .ThreadCnt ), zap .Int ("after" , limit ))
783
793
p .ThreadCnt = limit
784
794
}
795
+ if p .IsGlobalSort () {
796
+ p .DisableTiKVImportMode = true
797
+ }
785
798
}
786
799
787
800
func (p * Plan ) initParameters (plan * plannercore.ImportInto ) error {
0 commit comments