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