Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using import into on temporary table will cause tidb crash #55970

Closed
lcwangchao opened this issue Sep 10, 2024 · 1 comment · Fixed by #55983
Closed

using import into on temporary table will cause tidb crash #55970

lcwangchao opened this issue Sep 10, 2024 · 1 comment · Fixed by #55983
Labels
affects-7.5 affects-8.1 component/ddl This issue is related to DDL of TiDB. component/import severity/critical type/bug The issue is confirmed as a bug.

Comments

@lcwangchao
Copy link
Collaborator

lcwangchao commented Sep 10, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

> create global temporary table t1(a int, b int) on commit delete rows;
> import into t1(a, b) from '/tmp/a.csv';

2. What did you expect to see? (Required)

Maybe we should not allow to use import into on temporary table. At least, it should not cause any crash.

3. What did you see instead (Required)

Tidb crashs and cannot restart, some logs:

[2024/09/10 14:25:09.957 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 812.8µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 1.04ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 132ms, total-backoff-times: 8}"] [current-round-stats="{time: 100ms, backoff: 96ms, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:10.363 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 2.89ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 4.2ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 524ms, total-backoff-times: 11}"] [current-round-stats="{time: 393.5ms, backoff: 384ms, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:11.387 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 828.6µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 2.86ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 1.54s, total-backoff-times: 14}"] [current-round-stats="{time: 1.01s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:12.429 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 2.35ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 645.6µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 2.57s, total-backoff-times: 17}"] [current-round-stats="{time: 1.01s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:13.502 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 1.38ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 1.94ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 3.64s, total-backoff-times: 20}"] [current-round-stats="{time: 1.01s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:14.637 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 457.8µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 1.51ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 4.76s, total-backoff-times: 23}"] [current-round-stats="{time: 1s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:15.902 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 1.31ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 2.63ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 6.02s, total-backoff-times: 26}"] [current-round-stats="{time: 1.01s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:17.412 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 3.1ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 994.1µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 7.52s, total-backoff-times: 29}"] [current-round-stats="{time: 1.01s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:18.920 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 1.5ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 872.6µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 9.02s, total-backoff-times: 32}"] [current-round-stats="{time: 1s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:20.426 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 1.05ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 469.5µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 10.5s, total-backoff-times: 35}"] [current-round-stats="{time: 1s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:21.935 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 1.36ms, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 848.7µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 12s, total-backoff-times: 38}"] [current-round-stats="{time: 1.01s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:23.443 +08:00] [INFO] [region_request.go:968] ["throwing pseudo region error due to no replica available"] [req-ts=452447308293079042] [req-type=Get] [region="{ region id: 105, ver: 10, confVer: 3 }"] [replica-read-type=leader] [stale-read=false] [request-sender="{rpcError:<nil>, replicaSelector: replicaSelectorV2{replicaReadType: leader, attempts: 3, cacheRegionIsValid: false, replicaStatus: [peer: 106, store: 1, isEpochStale: false, attempts: 1, attempts_time: 663µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable peer: 170, store: 4, isEpochStale: false, attempts: 1, attempts_time: 865.3µs, replica-epoch: 0, store-epoch: 0, store-state: resolved, store-liveness-state: reachable]}}"] [total-round-stats="{total-backoff: 13.5s, total-backoff-times: 41}"] [current-round-stats="{time: 1s, backoff: 1s, timeout: 30s, req-max-exec-timeout: 30s, retry-times: 2}"]
[2024/09/10 14:25:24.453 +08:00] [INFO] [tidb.go:85] ["new domain"] [store=tikv-7412896298751648812] ["ddl lease"=45s] ["stats lease"=3s]
[2024/09/10 14:25:24.523 +08:00] [WARN] [info.go:317] ["init TiFlashReplicaManager"]
[2024/09/10 14:25:24.562 +08:00] [INFO] [domain.go:2907] [acquireServerID] [serverID=2041] ["lease id"=223191da9b682269]
[2024/09/10 14:25:24.569 +08:00] [INFO] [controller.go:199] ["load resource controller config"] [config="{\"degraded-mode-wait-duration\":\"0s\",\"ltb-max-wait-duration\":\"30s\",\"ltb-token-rpc-max-delay\":\"1s\",\"request-unit\":{\"read-base-cost\":0.125,\"read-per-batch-base-cost\":0.5,\"read-cost-per-byte\":0.0000152587890625,\"write-base-cost\":1,\"write-per-batch-base-cost\":1,\"write-cost-per-byte\":0.0009765625,\"read-cpu-ms-cost\":0.3333333333333333},\"enable-controller-trace-log\":\"false\",\"token-rpc-params\":{\"wait-retry-interval\":\"50ms\",\"wait-retry-times\":20}}"] [ru-config="{\"ReadBaseCost\":0.125,\"ReadPerBatchBaseCost\":0.5,\"ReadBytesCost\":0.0000152587890625,\"WriteBaseCost\":1,\"WritePerBatchBaseCost\":1,\"WriteBytesCost\":0.0009765625,\"CPUMsCost\":0.3333333333333333,\"LTBMaxWaitDuration\":30000000000,\"WaitRetryInterval\":50000000,\"WaitRetryTimes\":20,\"DegradedModeWaitDuration\":0}"]
[2024/09/10 14:25:24.585 +08:00] [INFO] [domain.go:381] ["full load InfoSchema success"] [isV2=true] [currentSchemaVersion=0] [neededSchemaVersion=52] ["elapsed time"=10.981ms]
[2024/09/10 14:25:24.593 +08:00] [INFO] [domain.go:763] ["full load and reset schema validator"]
[2024/09/10 14:25:24.601 +08:00] [INFO] [ddl.go:716] ["start DDL"] [category=ddl] [ID=c1705566-67a9-4e80-ac34-f12c2f11fecb] [runWorker=true]
[2024/09/10 14:25:24.602 +08:00] [INFO] [ddl.go:705] ["start delRangeManager OK"] [category=ddl] ["is a emulator"=false]
[2024/09/10 14:25:24.610 +08:00] [INFO] [manager.go:192] ["start campaign owner"] [ownerInfo="[ddl] /tidb/ddl/fg/owner"]
[2024/09/10 14:25:24.614 +08:00] [INFO] [env.go:109] ["the ingest sorted directory"] [category=ddl-ingest] ["data path"=/tmp/tidb/tmp_ddl-4000]
[2024/09/10 14:25:24.615 +08:00] [INFO] [env.go:81] ["init global ingest backend environment finished"] [category=ddl-ingest] ["memory limitation"=17179869184] ["disk usage info"="disk usage: 892755632128/1995218165760, backend usage: 0"] ["max open file number"=122880] ["lightning is initialized"=true]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=loadSchemaInLoop]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=mdlCheckLoop]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=topNSlowQueryLoop]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=infoSyncerKeeper]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=globalConfigSyncerKeeper]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=runawayStartLoop]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=requestUnitsWriterLoop]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=topologySyncerKeeper]
[2024/09/10 14:25:24.615 +08:00] [INFO] [runaway.go:68] ["try to start runaway manager loop"]
[2024/09/10 14:25:24.615 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=closestReplicaReadCheckLoop]
[2024/09/10 14:25:24.615 +08:00] [INFO] [owner_daemon.go:70] ["begin advancer daemon"] [daemon-id=LogBackup::Advancer]
[2024/09/10 14:25:24.624 +08:00] [INFO] [manager.go:192] ["start campaign owner"] [ownerInfo="[log-backup] /tidb/br-stream/owner"]
[2024/09/10 14:25:24.648 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=logBackupAdvancer]
[2024/09/10 14:25:24.649 +08:00] [INFO] [owner_daemon.go:81] ["begin running daemon"] [id=ab13ff1b-5a5f-4e51-812f-9d338c856ce5] [daemon-id=LogBackup::Advancer]
[2024/09/10 14:25:24.652 +08:00] [INFO] [manager.go:192] ["start campaign owner"] [ownerInfo="[bindinfo] /tidb/bindinfo/owner"]
[2024/09/10 14:25:24.659 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=globalBindHandleWorkerLoop]
[2024/09/10 14:25:24.659 +08:00] [WARN] [sysvar_cache.go:49] ["sysvar cache is empty, triggering rebuild"]
[2024/09/10 14:25:24.662 +08:00] [INFO] [sysvar.go:2873] ["set resource control"] [enable=true]
[2024/09/10 14:25:24.666 +08:00] [INFO] [controller.go:500] ["[resource group controller] create resource group cost controller"] [name=default]
[2024/09/10 14:25:24.678 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=loadPrivilegeInLoop]
[2024/09/10 14:25:24.679 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=LoadSysVarCacheLoop]
[2024/09/10 14:25:24.682 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=PlanReplayerTaskCollectHandle]
[2024/09/10 14:25:24.682 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=PlanReplayerTaskDumpHandle]
[2024/09/10 14:25:24.682 +08:00] [INFO] [domain.go:2124] ["PlanReplayerTaskCollectHandle started"]
[2024/09/10 14:25:24.682 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=dumpFileGcChecker]
[2024/09/10 14:25:24.682 +08:00] [INFO] [domain.go:2146] ["PlanReplayerTaskDumpHandle started"]
[2024/09/10 14:25:24.682 +08:00] [INFO] [domain.go:2178] ["dumpFileGcChecker started"]
[2024/09/10 14:25:24.682 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=HistoricalStatsWorker]
[2024/09/10 14:25:24.682 +08:00] [INFO] [plan_replayer.go:409] ["planReplayerTaskDumpWorker started."]
[2024/09/10 14:25:24.682 +08:00] [INFO] [domain.go:2211] ["HistoricalStatsWorker started"]
[2024/09/10 14:25:24.683 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=loadStatsWorker]
[2024/09/10 14:25:24.683 +08:00] [INFO] [manager.go:192] ["start campaign owner"] [ownerInfo="[stats] /tidb/stats/owner"]
[2024/09/10 14:25:24.685 +08:00] [INFO] [bootstrap.go:746] ["complete to load the meta in the lite mode"] [category=stats]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=indexUsageWorker]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=updateStatsWorker]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=handleDDLEvent]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=autoAnalyzeWorker]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=analyzeJobsCleanupWorker]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=RemoveInitStatsFromInternalSessions]
[2024/09/10 14:25:24.688 +08:00] [INFO] [domain.go:2369] ["start load stats sub workers"] ["worker count"=6]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=planCacheEvictTrigger]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=planCacheMetricsAndVars]
[2024/09/10 14:25:24.688 +08:00] [INFO] [domain.go:2496] ["handleDDLEvent started."]
[2024/09/10 14:25:24.688 +08:00] [INFO] [domain.go:2515] ["updateStatsWorker started."]
[2024/09/10 14:25:24.688 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=loadSigningCertLoop]
[2024/09/10 14:25:24.689 +08:00] [INFO] [gc_worker.go:196] [start] [category="gc worker"] [uuid=6476a6eeb300001]
[2024/09/10 14:25:24.689 +08:00] [INFO] [notifier.go:225] ["etcd notify loop to watch timer events started"] [EtcdKey=/tidb/timer/cluster/1/notify/10bdf1cb-f071-4b0d-b0b4-cee3862bb7bc]
[2024/09/10 14:25:24.690 +08:00] [INFO] [task_manager.go:222] ["scale ttl worker"] [ttl-worker=job-manager] [ttl-worker=task-manager] [originalCount=0] [newCount=4]
[2024/09/10 14:25:24.695 +08:00] [INFO] [task_manager.go:222] ["scale ttl worker"] [ttl-worker=job-manager] [ttl-worker=task-manager] [originalCount=0] [newCount=4]
[2024/09/10 14:25:24.691 +08:00] [INFO] [bootstrap.go:752] ["complete to load the histogram in the lite mode"] [category=stats]
[2024/09/10 14:25:24.696 +08:00] [INFO] [domain.go:2410] ["init stats info time"] [lite=true] ["take time"=13.460959ms]
[2024/09/10 14:25:24.697 +08:00] [INFO] [wait_group_wrapper.go:140] ["background process exited"] [source=domain] [process=RemoveInitStatsFromInternalSessions]
[2024/09/10 14:25:24.699 +08:00] [INFO] [manager.go:113] ["build task executor manager"] [total-cpu=10] [total-mem=32GiB]
[2024/09/10 14:25:24.704 +08:00] [INFO] [wait_group_wrapper.go:133] ["background process started"] [source=domain] [process=distTaskFrameworkLoop]
[2024/09/10 14:25:24.705 +08:00] [INFO] [manager.go:146] ["task executor manager start"]
[2024/09/10 14:25:24.705 +08:00] [INFO] [domain.go:1709] ["dist task executor manager started"]
[2024/09/10 14:25:25.013 +08:00] [INFO] [manager.go:328] ["task executor started"] [task-id=1] [type=ImportInto] [remaining-slots=5]
[2024/09/10 14:25:25.316 +08:00] [INFO] [task_executor.go:291] ["execute task step start"] [task-id=1] [task-type=ImportInto] [step=import] [mem-limit-percent=0.7] [server-mem-limit=80%] [resource="[CPU=5, Mem=16GiB]"]
[2024/09/10 14:25:25.317 +08:00] [INFO] [task_executor.go:97] ["init subtask env"] [type=ImportInto] [task-id=1] [step=import]
[2024/09/10 14:25:25.317 +08:00] [WARN] [table_import.go:120] ["sort dir already exists, remove it"] [table=t4] [sort_dir=/tmp/tidb/import-4000/1]
[2024/09/10 14:25:25.321 +08:00] [INFO] [pd_service_discovery.go:1018] ["[pd] switch leader"] [new-leader=http://127.0.0.1:2379] [old-leader=]
[2024/09/10 14:25:25.321 +08:00] [INFO] [pd_service_discovery.go:498] ["[pd] init cluster id"] [cluster-id=7412896298751648812]
[2024/09/10 14:25:25.321 +08:00] [INFO] [client.go:674] ["[pd] changing service mode"] [old-mode=UNKNOWN_SVC_MODE] [new-mode=PD_SVC_MODE]
[2024/09/10 14:25:25.321 +08:00] [INFO] [tso_client.go:295] ["[tso] switch dc tso global allocator serving url"] [dc-location=global] [new-url=http://127.0.0.1:2379]
[2024/09/10 14:25:25.322 +08:00] [INFO] [client.go:680] ["[pd] service mode changed"] [old-mode=UNKNOWN_SVC_MODE] [new-mode=PD_SVC_MODE]
[2024/09/10 14:25:25.322 +08:00] [INFO] [tso_client.go:132] ["[tso] start tso dispatcher check loop"]
[2024/09/10 14:25:25.322 +08:00] [INFO] [tso_dispatcher.go:119] ["[tso] start tso deadline watcher"] [dc-location=global]
[2024/09/10 14:25:25.322 +08:00] [INFO] [tso_dispatcher.go:168] ["[tso] tso dispatcher created"] [dc-location=global]
[2024/09/10 14:25:25.322 +08:00] [INFO] [tso_dispatcher.go:336] ["[tso] start tso connection contexts updater"] [dc-location=global]
[2024/09/10 14:25:25.324 +08:00] [INFO] [local.go:732] ["multi ingest support"] [category=ddl-ingest]
[2024/09/10 14:25:25.325 +08:00] [INFO] [local.go:754] ["TiKV server side free space check is enabled, so lightning will turn it off"] [category=ddl-ingest]
[2024/09/10 14:25:25.325 +08:00] [INFO] [table_import.go:739] ["use 0.8 of the storage size as default disk quota"] [table=t4] [quota=1.596TB]
[2024/09/10 14:25:25.325 +08:00] [INFO] [task_executor.go:116] ["KV writer memory size limit per concurrency"] [type=ImportInto] [task-id=1] [step=import] [data=1.6GiB] [per-index=546.1MiB]
[2024/09/10 14:25:25.326 +08:00] [INFO] [table_import.go:548] ["start checking disk quota"] [table=t4] [import-id=1] [disk-quota=1.452TiB]
[2024/09/10 14:25:25.327 +08:00] [INFO] [task_executor.go:353] ["subtask in running state and is idempotent"] [task-id=1] [task-type=ImportInto] [subtask-id=1]
[2024/09/10 14:25:25.327 +08:00] [INFO] [task_executor.go:124] ["run subtask start"] [type=ImportInto] [task-id=1] [step=import] [subtask-id=1]
[2024/09/10 14:25:25.372 +08:00] [INFO] [backend.go:268] ["open engine"] [category=ddl-ingest] [engineTag=`test`.`t4`:0] [engineUUID=4f8bfe47-d437-5ae8-9c06-84a12f623a30]
[2024/09/10 14:25:25.417 +08:00] [INFO] [backend.go:268] ["open engine"] [category=ddl-ingest] [engineTag=`test`.`t4`:-1] [engineUUID=dd45e90c-cc51-5b4e-933a-75dfb9524e19]
[2024/09/10 14:25:25.417 +08:00] [INFO] [subtask_executor.go:56] ["execute chunk"] [type=ImportInto] [table-id=104]
[2024/09/10 14:25:25.419 +08:00] [INFO] [chunk_process.go:330] ["process chunk start"] [type=ImportInto] [table-id=104] [key=a.csv:0]

4. What is your TiDB version? (Required)

@D3Hunter
Copy link
Contributor

D3Hunter commented Sep 10, 2024

if this happens, a workaround

  • if the job is importing from server file, or DXF is not enabled, the job will bind on the node where the session is connecting to, so other nodes are not affected. To cancel the stale import job, do the following:
    -- get the import job id
    show import jobs;
    
    -- update subtasks of the job to `reverted` state, remember to replace the job ID
    update mysql.tidb_background_subtask set state='reverted' where task_key=(select id from mysql.tidb_global_task where task_key='ImportInto/<job-id>');
    
    -- cancel the job
    cancel import job <job-id>
  • if DXF is enabled, and the job is importing from remote storage like s3, all TiDB instances might be affected as subtasks might be balanced to other instances on failover, in this case, we have to
    • stop all TiDB instances
    • start a new instance with DDL disabled, so this new instance will not try to elect owner and subtasks of the failed job will not be balanced to this instance, so this instance will not crash.
    [instance]
    tidb_enable_ddl = false
    • do the same step as above, to cancel the job
    • restart other TiDB instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 affects-8.1 component/ddl This issue is related to DDL of TiDB. component/import severity/critical type/bug The issue is confirmed as a bug.
Projects
None yet
2 participants