-
Notifications
You must be signed in to change notification settings - Fork 3.9k
sql/schemachange: draft to investigate descriptor not found (SQLSTATE XXUUU) #147544
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
Draft
Dedej-Bergin
wants to merge
2
commits into
cockroachdb:master
Choose a base branch
from
Dedej-Bergin:rsw-triggers-error
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+302
−12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Dedej-Bergin
commented
May 30, 2025
Added coverage for `CREATE TRIGGER` and `DROP TRIGGER` to the Random Schema Changer Workload. Fixes: cockroachdb#146580 Epic: CRDB-42942 Release note: none
… XXUUU) ``` { "message": "trigger_log table descriptor ID: 124" }, { "query": "SELECT EXISTS (SELECT table_name FROM information_schema.tables WHERE (table_schema = $1) AND (table_name = $2))", "queryArgs": [ "public", "table_w0_6" ], "result": true }, { "query": "SELECT EXISTS (SELECT table_name FROM information_schema.tables WHERE (table_schema = $1) AND (table_name = $2))", "queryArgs": [ "public", "table_w1_1" ], "result": true }, { "message": "Created trigger function CREATE FUNCTION trigger_function_w0_50() RETURNS TRIGGER AS $$ BEGIN INSERT INTO trigger_log VALUES (current_timestamp);SELECT t1.col1_w1_9 AS col0, t0.col6_w0_11 AS col1, t0.col6_w0_10 AS col2, t1.col1_w1_18 AS col3, t1.col1_w1_3 AS col4, t0.col6_w0_7 AS col5, t1.col1_w1_11 AS col6, t0.col6_w0_9 AS col7, t1.col1_w1_9 AS col8, t0.col6_w0_12 AS col9, t1.col1_w1_11 AS col10, t1.col1_w1_3 AS col11, t1.col1_w1_17 AS col12, t0.col6_w0_12 AS col13 FROM public.table_w0_6 AS t0 ,public.table_w1_1 AS t1 FETCH FIRST 1 ROWS ONLY;RETURN NULL;END; $$ LANGUAGE PLpgSQL" }, { "message": "createTrigger: CREATE FUNCTION trigger_function_w0_50() RETURNS TRIGGER AS $$ BEGIN INSERT INTO trigger_log VALUES (current_timestamp);SELECT t1.col1_w1_9 AS col0, t0.col6_w0_11 AS col1, t0.col6_w0_10 AS col2, t1.col1_w1_18 AS col3, t1.col1_w1_3 AS col4, t0.col6_w0_7 AS col5, t1.col1_w1_11 AS col6, t0.col6_w0_9 AS col7, t1.col1_w1_9 AS col8, t0.col6_w0_12 AS col9, t1.col1_w1_11 AS col10, t1.col1_w1_3 AS col11, t1.col1_w1_17 AS col12, t0.col6_w0_12 AS col13 FROM public.table_w0_6 AS t0 ,public.table_w1_1 AS t1 FETCH FIRST 1 ROWS ONLY;RETURN NULL;END; $$ LANGUAGE PLpgSQL;CREATE TRIGGER trigger_w0_51 AFTER INSERT OR DELETE ON public.table_w0_6 FOR EACH ROW EXECUTE FUNCTION trigger_function_w0_50()" } ], "previousStatements": [ "CREATE FUNCTION trigger_function_w0_50() RETURNS TRIGGER AS $$ BEGIN INSERT INTO trigger_log VALUES (current_timestamp);SELECT t1.col1_w1_9 AS col0, t0.col6_w0_11 AS col1, t0.col6_w0_10 AS col2, t1.col1_w1_18 AS col3, t1.col1_w1_3 AS col4, t0.col6_w0_7 AS col5, t1.col1_w1_11 AS col6, t0.col6_w0_9 AS col7, t1.col1_w1_9 AS col8, t0.col6_w0_12 AS col9, t1.col1_w1_11 AS col10, t1.col1_w1_3 AS col11, t1.col1_w1_17 AS col12, t0.col6_w0_12 AS col13 FROM public.table_w0_6 AS t0 ,public.table_w1_1 AS t1 FETCH FIRST 1 ROWS ONLY;RETURN NULL;END; $$ LANGUAGE PLpgSQL;CREATE TRIGGER trigger_w0_51 AFTER INSERT OR DELETE ON public.table_w0_6 FOR EACH ROW EXECUTE FUNCTION trigger_function_w0_50()" ] } } Schema Workload Stats Total Schema Statements Executed = 33 Total Schema Statements Succeeded = 33 Total Schema Statement Expected Failures = 0 Total Transactions Committed = 19 Total Transactions Rolled Back = 24 Total Transactions Executed = 43 test logs left over in: /Users/bdedej/go/src/github.com/cockroachdb/cockroach/y/_tmp/7d1af777aae5fb8cc05bf2aaa6382e4b/logTestWorkload1765799075 --- FAIL: TestWorkload (38.89s) test_log_scope.go:165: test logs captured to: /Users/bdedej/go/src/github.com/cockroachdb/cockroach/y/_tmp/7d1af777aae5fb8cc05bf2aaa6382e4b/logTestWorkload1765799075 test_log_scope.go:76: use -show-logs to present logs inline schema_change_external_test.go:132: Error Trace: pkg/ccl/testccl/workload/schemachange/schema_change_external_test.go:132 Error: Received unexpected error: ***UNEXPECTED COMMIT ERROR; Received an unexpected commit error: ERROR: error executing PreCommitPhase stage 2 of 2 with 20 MutationType ops: *scop.UpdateTableBackReferencesInRelations: &{{{}} 113 [{106 [2 8 10 16 17] 0} {124 [1] 0}]}: referenced descriptor ID 124: looking up ID 124: descriptor not found (SQLSTATE XXUUU) (1) forced error mark | "fatal error when running txn" | github.com/cockroachdb/errors/withstack/*withstack.withStack:: Wraps: (2) Wraps: (3) attached stack trace -- stack trace: | github.com/cockroachdb/cockroach/pkg/workload/schemachange.(*schemaChangeWorker).run | pkg/workload/schemachange/schemachange.go:705 | pkg/ccl/testccl/workload/schemachange/schemachange_test_test.TestWorkload.TestWorkload.func4.func6 | pkg/ccl/testccl/workload/schemachange/schema_change_external_test.go:121 | golang.org/x/sync/errgroup.(*Group).Go.func1 | external/org_golang_x_sync/errgroup/errgroup.go:78 | runtime.goexit | src/runtime/asm_arm64.s:1223 Wraps: (4) ***UNEXPECTED COMMIT ERROR; Received an unexpected commit error Wraps: (5) ERROR: error executing PreCommitPhase stage 2 of 2 with 20 MutationType ops: *scop.UpdateTableBackReferencesInRelations: &{{{}} 113 [{106 [2 8 10 16 17] 0} {124 [1] 0}]}: referenced descriptor ID 124: looking up ID 124: descriptor not found (SQLSTATE XXUUU) Error types: (1) *markers.withMark (2) *schemachange.ErrorState (3) *withstack.withStack (4) *errutil.withPrefix (5) *pgconn.PgError Test: TestWorkload schema_change_external_test.go:97: backup, tracing data, and system table dumps in /Users/bdedej/go/src/github.com/cockroachdb/cockroach/y/_tmp/7d1af777aae5fb8cc05bf2aaa6382e4b/logTestWorkload1765799075 panic.go:635: -- test log scope end -- FAIL ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.