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

Sentry: alter_table_drop_column.go:581: building declarative schema change targets for ALTER TABLE: failed to drop all of the relevant elements: [× ×] (1) attached stack trace -- stack trace: | ... #105754

Closed
cockroach-sentry opened this issue Jun 28, 2023 · 0 comments · Fixed by #106175

Comments

@cockroach-sentry
Copy link
Collaborator

cockroach-sentry commented Jun 28, 2023

This issue was auto filed by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.

Sentry Link: https://cockroach-labs.sentry.io/issues/4281301765/?referrer=webhooks_plugin

Panic Message:

alter_table_drop_column.go:581: building declarative schema change targets for ALTER TABLE: failed to drop all of the relevant elements: [× ×]
(1) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scerrors.EventLogger.HandlePanicAndLogError
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scerrors/errors.go:81
  | runtime.gopanic
  | 	GOROOT/src/runtime/panic.go:884
  | [...repeated from below...]
Wraps: (2) building declarative schema change targets for ALTER TABLE
Wraps: (3) assertion failure
Wraps: (4) attached stack trace
  -- stack trace:
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt.assertAllColumnElementsAreDropped
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go:581
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt.dropColumn
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go:315
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt.alterTableDropColumn
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go:45
  | reflect.Value.call
  | 	GOROOT/src/reflect/value.go:584
  | reflect.Value.Call
  | 	GOROOT/src/reflect/value.go:368
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt.AlterTable
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go:170
  | reflect.Value.call
  | 	GOROOT/src/reflect/value.go:584
  | reflect.Value.Call
  | 	GOROOT/src/reflect/value.go:368
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt.Process
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go:173
  | github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild.Build
  | 	github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/build.go:85
  | github.com/cockroachdb/cockroach/pkg/sql.(*planner).SchemaChange
  | 	github.com/cockroachdb/cockroach/pkg/sql/schema_change_plan_node.go:68
  | github.com/cockroachdb/cockroach/pkg/sql.buildOpaque
  | 	github.com/cockroachdb/cockroach/pkg/sql/opaque.go:56
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).tryBuildOpaque
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/opaque.go:70
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmt
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:434
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:272
  | github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder.(*Builder).Build
  | 	github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder/builder.go:246
  | github.com/cockroachdb/cockroach/pkg/sql.(*optPlanningCtx).buildExecMemo
  | 	github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:574
  | github.com/cockroachdb/cockroach/pkg/sql.(*planner).makeOptimizerPlan
  | 	github.com/cockroachdb/cockroach/pkg/sql/plan_opt.go:238
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).makeExecPlan
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1978
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).dispatchToExecutionEngine
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1484
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmtInOpenState
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:964
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:142
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execWithProfiling
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:2986
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execStmt
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:141
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2175
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).execCmd
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2180
  | github.com/cockroachdb/cockroach/pkg/sql.(*connExecutor).run
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:2097
  | github.com/cockroachdb/cockroach/pkg/sql.(*Server).ServeConn
  | 	github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:893
  | github.com/cockroachdb/cockroach/pkg/sql/pgwire.(*conn).processCommandsAsync.func1
  | 	github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:778
  | runtime.goexit
  | 	GOROOT/src/runtime/asm_amd64.s:1594
Wraps: (5) failed to drop all of the relevant elements: [× ×]
Error types: (1) *withstack.withStack (2) *errutil.withPrefix (3) *assert.withAssertionFailure (4) *withstack.withStack (5) *errutil.leafError
-- report composition:
*errutil.leafError: failed to drop all of the relevant elements: [× ×]
alter_table_drop_column.go:581: *withstack.withStack (top exception)
*assert.withAssertionFailure
*errutil.withPrefix: building declarative schema change targets for ALTER TABLE
errors.go:81: *withstack.withStack (1)
(check the extra data payloads)
Stacktrace (expand for inline code snippets):

GOROOT/src/runtime/asm_amd64.s#L1593-L1595
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/pgwire/conn.go#L777-L779
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor.go#L892-L894
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor.go#L2096-L2098
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor.go#L2179-L2181
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor.go#L2174-L2176
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L140-L142
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L2985-L2987
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L141-L143
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L963-L965
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L1483-L1485
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L1977-L1979
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/plan_opt.go#L237-L239
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/plan_opt.go#L573-L575
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opt/optbuilder/builder.go#L245-L247
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opt/optbuilder/builder.go#L271-L273
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opt/optbuilder/builder.go#L433-L435
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opt/optbuilder/opaque.go#L69-L71
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opaque.go#L55-L57
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schema_change_plan_node.go#L67-L69
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/build.go#L84-L86
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go#L172-L174
GOROOT/src/reflect/value.go#L367-L369
GOROOT/src/reflect/value.go#L583-L585
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go#L169-L171
GOROOT/src/reflect/value.go#L367-L369
GOROOT/src/reflect/value.go#L583-L585
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go#L44-L46
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go#L314-L316
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go#L580-L582
GOROOT/src/runtime/panic.go#L883-L885
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scerrors/errors.go#L80-L82
GOROOT/src/runtime/asm_amd64.s#L1593-L1595
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/pgwire/conn.go#L777-L779
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor.go#L892-L894
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor.go#L2096-L2098
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor.go#L2179-L2181
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor.go#L2174-L2176
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L140-L142
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L2985-L2987
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L141-L143
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L963-L965
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L1483-L1485
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/conn_executor_exec.go#L1977-L1979
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/plan_opt.go#L237-L239
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/plan_opt.go#L573-L575
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opt/optbuilder/builder.go#L245-L247
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opt/optbuilder/builder.go#L271-L273
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opt/optbuilder/builder.go#L433-L435
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opt/optbuilder/opaque.go#L69-L71
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/opaque.go#L55-L57
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schema_change_plan_node.go#L67-L69
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/build.go#L84-L86
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go#L172-L174
GOROOT/src/reflect/value.go#L367-L369
GOROOT/src/reflect/value.go#L583-L585
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go#L169-L171
GOROOT/src/reflect/value.go#L367-L369
GOROOT/src/reflect/value.go#L583-L585
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go#L44-L46
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go#L314-L316
https://github.com/cockroachdb/cockroach/blob/d8d427b1574281f7dc16da266867279c13cdbfd6/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go#L580-L582

GOROOT/src/runtime/asm_amd64.s in runtime.goexit at line 1594
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).processCommandsAsync.func1 at line 778
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 893
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 2097
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 2180
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd.func1 at line 2175
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 141
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithProfiling at line 2986
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt.func1 at line 142
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 964
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 1484
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).makeExecPlan at line 1978
pkg/sql/plan_opt.go in pkg/sql.(*planner).makeOptimizerPlan at line 238
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildExecMemo at line 574
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build at line 246
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 272
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 434
pkg/sql/opt/optbuilder/opaque.go in pkg/sql/opt/optbuilder.(*Builder).tryBuildOpaque at line 70
pkg/sql/opaque.go in pkg/sql.buildOpaque at line 56
pkg/sql/schema_change_plan_node.go in pkg/sql.(*planner).SchemaChange at line 68
pkg/sql/schemachanger/scbuild/build.go in pkg/sql/schemachanger/scbuild.Build at line 85
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.Process at line 173
GOROOT/src/reflect/value.go in reflect.Value.Call at line 368
GOROOT/src/reflect/value.go in reflect.Value.call at line 584
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.AlterTable at line 170
GOROOT/src/reflect/value.go in reflect.Value.Call at line 368
GOROOT/src/reflect/value.go in reflect.Value.call at line 584
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.alterTableDropColumn at line 45
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.dropColumn at line 315
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.assertAllColumnElementsAreDropped at line 581
GOROOT/src/runtime/panic.go in runtime.gopanic at line 884
pkg/sql/schemachanger/scerrors/errors.go in pkg/sql/schemachanger/scerrors.EventLogger.HandlePanicAndLogError at line 81
GOROOT/src/runtime/asm_amd64.s in runtime.goexit at line 1594
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).processCommandsAsync.func1 at line 778
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 893
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 2097
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd at line 2180
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).execCmd.func1 at line 2175
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 141
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithProfiling at line 2986
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt.func1 at line 142
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 964
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 1484
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).makeExecPlan at line 1978
pkg/sql/plan_opt.go in pkg/sql.(*planner).makeOptimizerPlan at line 238
pkg/sql/plan_opt.go in pkg/sql.(*optPlanningCtx).buildExecMemo at line 574
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build at line 246
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 272
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 434
pkg/sql/opt/optbuilder/opaque.go in pkg/sql/opt/optbuilder.(*Builder).tryBuildOpaque at line 70
pkg/sql/opaque.go in pkg/sql.buildOpaque at line 56
pkg/sql/schema_change_plan_node.go in pkg/sql.(*planner).SchemaChange at line 68
pkg/sql/schemachanger/scbuild/build.go in pkg/sql/schemachanger/scbuild.Build at line 85
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/process.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.Process at line 173
GOROOT/src/reflect/value.go in reflect.Value.Call at line 368
GOROOT/src/reflect/value.go in reflect.Value.call at line 584
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.AlterTable at line 170
GOROOT/src/reflect/value.go in reflect.Value.Call at line 368
GOROOT/src/reflect/value.go in reflect.Value.call at line 584
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.alterTableDropColumn at line 45
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.dropColumn at line 315
pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go in pkg/sql/schemachanger/scbuild/internal/scbuildstmt.assertAllColumnElementsAreDropped at line 581

Tags

Tag Value
Command mt start-sql
Environment v23.1.4
Go Version go1.19.4
Platform linux amd64
Distribution CCL
Cockroach Release v23.1.3-121-gd8d427b1574
Cockroach SHA d8d427b1574281f7dc16da266867279c13cdbfd6
# of CPUs 32
# of Goroutines 334

Jira issue: CRDB-29175

postamar pushed a commit to postamar/cockroach that referenced this issue Jul 6, 2023
The declarative schema changer builder contains assertions on the state
of elements and their targets and these could sometimes fail because the
check which verifies that the corresponding descriptors are not already
undergoing a schema change was performed later. This commit fixes this
by moving the check earlier so the assertion is never reached in those
cases.

This commit removes a skipped test which is superseded by a new test in
the schemachanger package.

Fixes: cockroachdb#45510
Fixes: cockroachdb#102927
Fixes: cockroachdb#105754

Release note (bug fix): fixed a bug which manifested itself in error
messages containing "failed to drop all of the relevant elements" when
executing DDL statements with the declarative schema changer. What this
really means is that there's a concurrent schema change that's ongoing.
Instead we now behave as expected and wait for it to finish.
postamar pushed a commit to postamar/cockroach that referenced this issue Jul 6, 2023
The declarative schema changer builder contains assertions on the state
of elements and their targets and these could sometimes fail because the
check which verifies that the corresponding descriptors are not already
undergoing a schema change was performed later. This commit fixes this
by moving the check earlier so the assertion is never reached in those
cases.

This commit removes a skipped test which is superseded by a new test in
the schemachanger package.

Fixes: cockroachdb#45510
Fixes: cockroachdb#102927
Fixes: cockroachdb#105754

Release note (bug fix): fixed a bug which manifested itself in error
messages containing "failed to drop all of the relevant elements" when
executing DDL statements with the declarative schema changer. What this
really means is that there's a concurrent schema change that's ongoing.
Instead we now behave as expected and wait for it to finish.
craig bot pushed a commit that referenced this issue Jul 6, 2023
105795: asim: add exact_bound, upper_bound, lower_bound to CmdArgs r=kvoli a=wenyihu6

**asim: move sim helper functions to helpers_test.go**

This patch moves helper functions for scanning and parsing arguments from
`datadriven_simulation_test.go` to `helpers_test.go`.

Note that this commit does not change any existing functionality.

Epic: None

Release Note: None

---

**asim: add exact_bound, upper_bound, lower_bound to CmdArgs**

Previously, the allocator simulator's assertions were limited to accepting only
a single threshold value for type=balance, type=steady, and type=stat
assertions. This single threshold functioned as an upper limit for balance and
steady and as an exact limit for stat. This is less ideal as there are instances
where different types of bounds need to be asserted. To improve this, this patch
replaces the argument `threshold=` with 
`exact_bound=, upper_bound=, and lower_bound=`. Note that only one 
argument should be specified at a time. If multiple are specified, the expected 
precedence order is exact_bound > upper_bound > lower_bound.

Note that this commit does not change any existing functionality.

Epic: None

Release Note: None

106175: schemachanger,scbuild: fix assertion bug r=postamar a=postamar

The declarative schema changer builder contains assertions on the state of elements and their targets and these could sometimes fail because the check which verifies that the corresponding descriptors are not already undergoing a schema change was performed later. This commit fixes this by moving the check earlier so the assertion is never reached in those cases.

This commit removes a skipped test which is superseded by a new test in the schemachanger package.

Fixes: #45510
Fixes: #102927
Fixes: #105754

Release note (bug fix): fixed a bug which manifested itself in error messages containing "failed to drop all of the relevant elements" when executing DDL statements with the declarative schema changer. What this really means is that there's a concurrent schema change that's ongoing. Instead we now behave as expected and wait for it to finish.

Co-authored-by: Wenyi <[email protected]>
Co-authored-by: Marius Posta <[email protected]>
@craig craig bot closed this as completed in fbd7d65 Jul 6, 2023
@craig craig bot closed this as completed in #106175 Jul 6, 2023
@exalate-issue-sync exalate-issue-sync bot changed the title Sentry: alter_table_drop_column.go:581: building declarative schema change targets for ALTER TABLE: failed to drop all of the relevant elements: [× ×] (1) attached stack trace -- stack trace: | ... Sentry: alter_table_drop_column.go:581: building declarative schema change targets for ALTER TABLE: failed to drop all of the relevant elements: [× ×] (1) attached stack trace -- stack trace: | ... Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant