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