@@ -31,7 +31,6 @@ import (
31
31
"github.com/pingcap/errors"
32
32
"github.com/pingcap/tidb/pkg/bindinfo"
33
33
"github.com/pingcap/tidb/pkg/config"
34
- "github.com/pingcap/tidb/pkg/disttask/framework/proto"
35
34
"github.com/pingcap/tidb/pkg/domain"
36
35
"github.com/pingcap/tidb/pkg/domain/infosync"
37
36
"github.com/pingcap/tidb/pkg/expression"
@@ -1332,51 +1331,6 @@ var (
1332
1331
SupportUpgradeHTTPOpVer int64 = version174
1333
1332
)
1334
1333
1335
- func checkDistTask (s sessiontypes.Session , ver int64 ) {
1336
- if ver > version195 {
1337
- // since version195 we enable dist task by default, no need to check
1338
- return
1339
- }
1340
- ctx := kv .WithInternalSourceType (context .Background (), kv .InternalTxnBootstrap )
1341
- rs , err := s .ExecuteInternal (ctx , "SELECT HIGH_PRIORITY variable_value from mysql.global_variables where variable_name = %?;" , variable .TiDBEnableDistTask )
1342
- if err != nil {
1343
- logutil .BgLogger ().Fatal ("check dist task failed, getting tidb_enable_dist_task failed" , zap .Error (err ))
1344
- }
1345
- defer terror .Call (rs .Close )
1346
- req := rs .NewChunk (nil )
1347
- err = rs .Next (ctx , req )
1348
- if err != nil {
1349
- logutil .BgLogger ().Fatal ("check dist task failed, getting tidb_enable_dist_task failed" , zap .Error (err ))
1350
- }
1351
- if req .NumRows () == 0 {
1352
- // Not set yet.
1353
- return
1354
- } else if req .GetRow (0 ).GetString (0 ) == variable .On {
1355
- logutil .BgLogger ().Fatal ("check dist task failed, tidb_enable_dist_task is enabled" , zap .Error (err ))
1356
- }
1357
-
1358
- // Even if the variable is set to `off`, we still need to check the tidb_global_task.
1359
- rs2 , err := s .ExecuteInternal (ctx , `SELECT id FROM %n.%n WHERE state not in (%?, %?, %?)` ,
1360
- mysql .SystemDB ,
1361
- "tidb_global_task" ,
1362
- proto .TaskStateSucceed ,
1363
- proto .TaskStateFailed ,
1364
- proto .TaskStateReverted ,
1365
- )
1366
- if err != nil {
1367
- logutil .BgLogger ().Fatal ("check dist task failed, reading tidb_global_task failed" , zap .Error (err ))
1368
- }
1369
- defer terror .Call (rs2 .Close )
1370
- req = rs2 .NewChunk (nil )
1371
- err = rs2 .Next (ctx , req )
1372
- if err != nil {
1373
- logutil .BgLogger ().Fatal ("check dist task failed, reading tidb_global_task failed" , zap .Error (err ))
1374
- }
1375
- if req .NumRows () > 0 {
1376
- logutil .BgLogger ().Fatal ("check dist task failed, some distributed tasks is still running" , zap .Error (err ))
1377
- }
1378
- }
1379
-
1380
1334
// upgrade function will do some upgrade works, when the system is bootstrapped by low version TiDB server
1381
1335
// For example, add new system variables into mysql.global_variables table.
1382
1336
func upgrade (s sessiontypes.Session ) {
@@ -1387,7 +1341,6 @@ func upgrade(s sessiontypes.Session) {
1387
1341
return
1388
1342
}
1389
1343
1390
- checkDistTask (s , ver )
1391
1344
printClusterState (s , ver )
1392
1345
1393
1346
// Only upgrade from under version92 and this TiDB is not owner set.
0 commit comments