-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
v22.1.0: sql: cannot use CheckPrivilege without a txn during prepared statement #82034
Comments
According to Sentry, the statement is |
must relate to #80764 |
i wonder if there's any chance that #82622 fixes this |
This still reproduces on the randomized schema changer workload with that fix on a recent master. Unfortunately, I haven't gotten the changes that repro this merged yet its on a development branch for it |
From an internal support case, I think I'm beginning to see how this can happen. This is just a theory. If you run a statement like Line 281 in fc456a2
This internal query can fail with a TransactionRetryError, which eventually causes the connExecutor's txn to be nil'd: cockroach/pkg/sql/txn_state.go Line 265 in fc456a2
Since that internal query is using placeholder arguments, it runs as a prepared statement. Perhaps that somehow leads to cockroach/pkg/sql/conn_executor_prepare.go Line 241 in fc456a2
While preparing that statement, the optimizer needs to check privileges, and encounters the |
85996: sql: don't panic on auth check with unopen txn r=ajwerner,RichardJCai a=rafiss Relates to #80764 and #82034 Ever since c00ea84 was merged, the KV layer has disallowed use of an aborted txn. Therefore, the checks here are no longer necessary. This should actually help with debugging, since now if the aborted txn is used, we should get back an error that has the reason for the abort (or restart), instead of a panic that does not have that info. Release note: None Co-authored-by: Rafi Shamim <[email protected]>
#85996 fixes this specific error, which usually is a sign of incorrect error handling elsewhere. closing this |
This issue was autofiled by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.
Sentry link: https://sentry.io/organizations/cockroach-labs/issues/3309794281/?referrer=webhooks_plugin
Panic message:
Stacktrace (expand for inline code snippets):
cockroach/pkg/sql/authorization.go
Lines 128 to 130 in 5b78463
cockroach/pkg/sql/authorization.go
Lines 742 to 744 in 5b78463
cockroach/pkg/sql/opt_catalog.go
Lines 213 to 215 in 5b78463
cockroach/pkg/sql/opt/metadata.go
Lines 292 to 294 in 5b78463
cockroach/pkg/sql/opt/memo/memo.go
Lines 332 to 334 in 5b78463
cockroach/pkg/sql/plan_opt.go
Lines 118 to 120 in 5b78463
cockroach/pkg/sql/conn_executor_prepare.go
Lines 277 to 279 in 5b78463
cockroach/pkg/sql/conn_executor_prepare.go
Lines 234 to 236 in 5b78463
cockroach/pkg/sql/conn_executor_prepare.go
Lines 239 to 241 in 5b78463
cockroach/pkg/sql/conn_executor_prepare.go
Lines 101 to 103 in 5b78463
cockroach/pkg/sql/conn_executor_prepare.go
Lines 62 to 64 in 5b78463
cockroach/pkg/sql/conn_executor.go
Lines 1974 to 1976 in 5b78463
cockroach/pkg/sql/conn_executor.go
Lines 1798 to 1800 in 5b78463
cockroach/pkg/sql/conn_executor.go
Lines 746 to 748 in 5b78463
cockroach/pkg/sql/pgwire/conn.go
Lines 723 to 725 in 5b78463
GOROOT/src/runtime/asm_amd64.s#L1580-L1582 in runtime.goexit
v22.1.0
Jira issue: CRDB-16177
gz#13333
The text was updated successfully, but these errors were encountered: