Skip to content

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
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dedej-Bergin
Copy link
Contributor

   {
    "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

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
```
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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 this pull request may close these issues.

2 participants