cockroach
cockroach copied to clipboard
sql,cloud: cloud SQL shell can crash a node
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:
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