Open
Description
Is your feature request related to a problem? Please describe.
We should add operations that interact with roles to the random schema change workload. I envision that this will look like at least the below operations.
diff --git a/pkg/workload/schemachange/schemachange.go b/pkg/workload/schemachange/schemachange.go
index 42bfc6a4cc..9917730b71 100644
--- a/pkg/workload/schemachange/schemachange.go
+++ b/pkg/workload/schemachange/schemachange.go
@@ -116,6 +116,7 @@ const (
createTableAs // CREATE TABLE <table> AS <def>
createView // CREATE VIEW <view> AS <def>
createEnum // CREATE TYPE <type> ENUM AS <def>
+ createRole // CREATE ROLE [IF NOT EXISTS] <name> [ [WITH] <OPTIONS...> ]
dropColumn // ALTER TABLE <table> DROP COLUMN <column>
dropColumnDefault // ALTER TABLE <table> ALTER [COLUMN] <column> DROP DEFAULT
@@ -138,6 +139,12 @@ const (
setColumnType // ALTER TABLE <table> ALTER [COLUMN] <column> [SET DATA] TYPE <type>
insertRow // INSERT INTO <table> (<cols>) VALUES (<values>)
+
+ grantPrivilege // GRANT {ALL | <privileges...> } ON <targets...> TO <grantees...>
+ grantRole // GRANT <roles...> TO <grantees...> [WITH ADMIN OPTION]
+
+ revokePrivilege // REVOKE {ALL | <privileges...> } ON <targets...> FROM <grantees...>
+ revokeRole // REVOKE [ADMIN OPTION FOR] <roles...> FROM <grantees...>
)
We can also have transactions execute SET LOCAL ROLE = random_role_name
at the beginning of the transaction, with some probability.
Jira issue: CRDB-3703
Epic CRDB-19168