docs/agents/import-into/README.md
This note is a navigation and troubleshooting map for IMPORT INTO in DXF. It focuses on conflict-resolution and cleanup behavior that is easy to miss when only reading one package at a time.
mysql.tidb_import_jobs + DXF task).pkg/dxf/importinto/job.gopkg/dxf/importinto/scheduler.gopkg/dxf/framework/proto/step.gopkg/dxf/importinto/planner.gopkg/dxf/importinto/task_executor.gopkg/dxf/importinto/collect_conflicts.gopkg/dxf/importinto/conflict_resolution.gopkg/dxf/importinto/subtask_executor.gopkg/dxf/importinto/clean_up.gopkg/dxf/importinto/conflictedkv/doc.goStepInit -> ImportStepImport -> ImportStepPostProcess -> StepDoneStepInit -> ImportStepEncodeAndSort -> ImportStepMergeSort (optional
subtasks) -> ImportStepWriteAndIngest -> ImportStepCollectConflicts
(optional subtasks) -> ImportStepConflictResolution (optional subtasks) ->
ImportStepPostProcess -> StepDone"Why are collect-conflicts / conflict-resolution steps skipped?"
generateCollectConflictsSpecs and generateConflictResolutionSpecs return
no specs when collectConflictInfos finds no recorded conflicts.RecordedConflictKVCount > 0 in:
ImportStepMetaMergeSortStepMetaWriteIngestStepMeta"Why is checksum verification skipped in post-process?"
TooManyConflictsFromIndex is set when the bounded
in-memory handle set exceeds its limit.sizeLimitOfHandlesFromIndex = resource mem / 2)."Where are conflicted rows persisted?"
conflicted-rows/<task-id>/<subtask-id>-<uuid><task-id>/ cleanup path, so users can
inspect conflict rows after task cleanup."Where is each part executed?"
collect_conflicts.goconflict_resolution.goconflictedkv/doc.goImportCleanUp.CleanUp in clean_up.go.infoschema.ErrTableNotExists during cleanup.external.CleanUpFiles(..., <task-id>).conflicted-rows/... files by design.getTaskMgrForAccessingImportJob).errGetCrossKSSessionPool, and treated as retryable.rg --line-number --glob '*.go' 'GetNextStep|startJob|job2Step|finishJob|failJob|cancelJob' pkg/dxf/importintorg --line-number --glob '*.go' 'generateCollectConflictsSpecs|generateConflictResolutionSpecs|RecordedConflictKVCount|collectConflictInfos' pkg/dxf/importintorg --line-number --glob '*.go' 'CollectConflictsStepMeta|ConflictResolutionStepMeta|TooManyConflictsFromIndex|conflicted-rows' pkg/dxf/importintorg --line-number --glob '*.go' 'ImportCleanUp|CleanUpFiles|sendMeterOnCleanUp|redactSensitiveInfo' pkg/dxf/importinto pkg/dxf/framework/schedulerpkg/dxf/importinto/conflict_resolution_test.gopkg/dxf/importinto/collect_conflicts_test.gopkg/dxf/importinto/task_executor_test.gopkg/dxf/importinto/scheduler_test.gopkg/dxf/importinto/job_testkit_test.go