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

v7.5.2(upgrade from 7.1.5) show import jobs report unknow column summary #54241

Closed
D3Hunter opened this issue Jun 26, 2024 · 3 comments · Fixed by #54787
Closed

v7.5.2(upgrade from 7.1.5) show import jobs report unknow column summary #54241

D3Hunter opened this issue Jun 26, 2024 · 3 comments · Fixed by #54787
Assignees
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. component/disttask distributed execute framework of tidb severity/major type/bug The issue is confirmed as a bug. type/regression

Comments

@D3Hunter
Copy link
Contributor

D3Hunter commented Jun 26, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

[2024/06/25 09:17:18.256 +08:00] [INFO] [conn.go:1116] ["command dispatched failed"] [conn=4080637346] [session_alias=] [connInfo="id:4080637346, addr:172.21.82.187:45984 status:10, collation:utf8_general_ci, user:lightling"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="show import jobs"] [txn_mode=PESSIMISTIC] [timestamp=0] [err="[planner:1054]Unknown column 'summary' in 'field list'\ngithub.com/pingcap/errors.AddStack\n\t/root/go/pkg/mod/github.com/pingcap/[email protected]/errors.go:178\ngithub.com/pingcap/errors.(*Error).GenWithStackByArgs\n\t/root/go/pkg/mod/github.com/pingcap/[email protected]/normalize.go:175\ngithub.com/pingcap/tidb/pkg/planner/core.(*expressionRewriter).toColumn\n\t/workspace/source/tidb/pkg/planner/core/expression_rewriter.go:2204\ngithub.com/pingcap/tidb/pkg/planner/core.(*expressionRewriter).Leave\n\t/workspace/source/tidb/pkg/planner/core/expression_rewriter.go:1258\ngithub.com/pingcap/tidb/pkg/parser/ast.(*ColumnName).Accept\n\t/workspace/source/tidb/pkg/parser/ast/expressions.go:534\ngithub.com/pingcap/tidb/pkg/parser/ast.(*ColumnNameExpr).Accept\n\t/workspace/source/tidb/pkg/parser/ast/expressions.go:596\ngithub.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).rewriteExprNode\n\t/workspace/source/tidb/pkg/planner/core/expression_rewriter.go:201\ngithub.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).rewriteWithPreprocess\n\t/workspace/source/tidb/pkg/planner/core/expression_rewriter.go:146\ngithub.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildProjection\n\t/workspace/source/tidb/pkg/planner/core/logical_plan_builder.go:1804\ngithub.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).buildSelect\n\t/workspace/source/tidb/pkg/planner/core/logical_plan_builder.go:4597\ngithub.com/pingcap/tidb/pkg/planner/core.(*PlanBuilder).Build\n\t/workspace/source/tidb/pkg/planner/core/planbuilder.go:859\ngithub.com/pingcap/tidb/pkg/planner.buildLogicalPlan\n\t/workspace/source/tidb/pkg/planner/optimize.go:576\ngithub.com/pingcap/tidb/pkg/planner.optimize\n\t/workspace/source/tidb/pkg/planner/optimize.go:494\ngithub.com/pingcap/tidb/pkg/planner.Optimize\n\t/workspace/source/tidb/pkg/planner/optimize.go:352\ngithub.com/pingcap/tidb/pkg/executor.(*Compiler).Compile\n\t/workspace/source/tidb/pkg/executor/compiler.go:98\ngithub.com/pingcap/tidb/pkg/session.(*session).ExecuteStmt\n\t/workspace/source/tidb/pkg/session/session.go:2221\ngithub.com/pingcap/tidb/pkg/session.(*session).ExecuteInternal\n\t/workspace/source/tidb/pkg/session/session.go:1657\ngithub.com/pingcap/tidb/pkg/disttask/framework/storage.ExecSQL\n\t/workspace/source/tidb/pkg/disttask/framework/storage/task_table.go:97\ngithub.com/pingcap/tidb/pkg/disttask/framework/storage.(*TaskManager).GetSubtasksForImportInto.func1\n\t/workspace/source/tidb/pkg/disttask/framework/storage/task_table.go:924\ngithub.com/pingcap/tidb/pkg/disttask/framework/storage.(*TaskManager).WithNewTxn.func1\n\t/workspace/source/tidb/pkg/disttask/framework/storage/task_table.go:168\ngithub.com/pingcap/tidb/pkg/disttask/framework/storage.(*TaskManager).WithNewSession\n\t/workspace/source/tidb/pkg/disttask/framework/storage/task_table.go:144\ngithub.com/pingcap/tidb/pkg/disttask/framework/storage.(*TaskManager).WithNewTxn\n\t/workspace/source/tidb/pkg/disttask/framework/storage/task_table.go:150\ngithub.com/pingcap/tidb/pkg/disttask/framework/storage.(*TaskManager).GetSubtasksForImportInto\n\t/workspace/source/tidb/pkg/disttask/framework/storage/task_table.go:913\ngithub.com/pingcap/tidb/pkg/disttask/importinto.GetTaskImportedRows\n\t/workspace/source/tidb/pkg/disttask/importinto/job.go:269\ngithub.com/pingcap/tidb/pkg/executor.handleImportJobInfo\n\t/workspace/source/tidb/pkg/executor/show.go:2300\ngithub.com/pingcap/tidb/pkg/executor.(*ShowExec).fetchShowImportJobs\n\t/workspace/source/tidb/pkg/executor/show.go:2347\ngithub.com/pingcap/tidb/pkg/executor.(*ShowExec).fetchAll\n\t/workspace/source/tidb/pkg/executor/show.go:288\ngithub.com/pingcap/tidb/pkg/executor.(*ShowExec).Next\n\t/workspace/source/tidb/pkg/executor/show.go:131\ngithub.com/pingcap/tidb/pkg/executor/internal/exec.Next\n\t/workspace/source/tidb/pkg/executor/internal/exec/executor.go:283\ngithub.com/pingcap/tidb/pkg/executor.(*ExecStmt).next\n\t/workspace/source/tidb/pkg/executor/adapter.go:1216\ngithub.com/pingcap/tidb/pkg/executor.(*recordSet).Next\n\t/workspace/source/tidb/pkg/executor/adapter.go:156\ngithub.com/pingcap/tidb/pkg/server/internal/resultset.(*tidbResultSet).Next\n\t/workspace/source/tidb/pkg/server/internal/resultset/resultset.go:62"]

it's because we didn't add summary column for the history table, see

tidb/pkg/session/bootstrap.go

Lines 2819 to 2824 in 8bf55a4

func upgradeToVer173(s sessiontypes.Session, ver int64) {
if ver >= version173 {
return
}
doReentrantDDL(s, "ALTER TABLE mysql.tidb_background_subtask ADD COLUMN `summary` JSON", infoschema.ErrColumnExists)
}

new created clusters of version >= 7.5.0 are not affected

a temp workaround is to add the column manually using

ALTER TABLE mysql.tidb_background_subtask_history ADD COLUMN `summary` JSON

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

7.5.2

@D3Hunter D3Hunter added the type/bug The issue is confirmed as a bug. label Jun 26, 2024
@D3Hunter
Copy link
Contributor Author

it's introduced in #46562, since v7.4.0

@D3Hunter D3Hunter added severity/major component/ddl This issue is related to DDL of TiDB. labels Jun 26, 2024
@D3Hunter D3Hunter added component/disttask distributed execute framework of tidb affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. and removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 labels Jun 26, 2024
@D3Hunter
Copy link
Contributor Author

will fix this after we have enough reserved versions for v8.1, i.e. after @glorv add the gap for #54033

@tangenta tangenta self-assigned this Jul 19, 2024
@kennedy8312
Copy link

/type regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. component/disttask distributed execute framework of tidb severity/major type/bug The issue is confirmed as a bug. type/regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants