cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

sql,cloud: cloud SQL shell can crash a node

Open DrewKimball opened this issue 9 months ago • 1 comments

It's possible to crash a node in a CC cluster through the SQL shell by attempting to run COMMIT or EXECUTE. This happens because requests through the cloud SQL shell run through an internal executor, which does not support committing the transaction, so a panic results. A crash occurs for similar reasons after SHOW COMMIT TIMESTAMP. There may be other statements that are incompatible with the internal executor as well.

The following is a screenshot I took of a graph of kubernetes node restarts after running COMMIT and ROLLBACK through the shell on a CC dedicated test cluster: Screenshot 2024-05-23 at 5 47 04 PM

We probably need to set up a list of disallowed statements for the cloud shell. For reference, we recently introduced a crdb_internal.execute_internally builtin function that has to do something similar: https://github.com/cockroachdb/cockroach/blob/5d90eb7f6d58aa23882c3dd7e5649cabc064b3e4/pkg/sql/sem/builtins/generator_builtins.go#L3595-L3602 However, we may want to relax the restriction somewhat, since it probably prohibits some safe statements.

Jira issue: CRDB-38983

DrewKimball avatar May 24 '24 00:05 DrewKimball