Skip to content
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

workload/schemachange: add role operations #54938

Open
ajwerner opened this issue Sep 29, 2020 · 1 comment
Open

workload/schemachange: add role operations #54938

ajwerner opened this issue Sep 29, 2020 · 1 comment
Labels
A-random-schema-change-workload A-schema-changes A-testing Testing tools and infrastructure C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@ajwerner
Copy link
Contributor

ajwerner commented Sep 29, 2020

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

@blathers-crl
Copy link

blathers-crl bot commented Sep 29, 2020

Hi @ajwerner, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate.

While you're here, please consider adding an A- label to help keep our repository tidy.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Sep 29, 2020
@ajwerner ajwerner added this to Triage in SQL Foundations via automation Sep 29, 2020
@ajwerner ajwerner added the A-testing Testing tools and infrastructure label Sep 29, 2020
@thoszhang thoszhang moved this from Triage to Backlog in SQL Foundations Sep 29, 2020
@jlinder jlinder added the T-sql-schema-deprecated Use T-sql-foundations instead label Jun 16, 2021
@postamar postamar added A-random-schema-change-workload C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. and removed C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) labels Nov 10, 2022
@postamar postamar moved this from Backlog to Tech Debt That Nobody Outside Of The Team Cares About in SQL Foundations Nov 10, 2022
@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-schema-deprecated Use T-sql-foundations instead labels May 10, 2023
@rafiss rafiss added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-random-schema-change-workload A-schema-changes A-testing Testing tools and infrastructure C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
SQL Foundations
  
Tech Debt That Nobody Outside Of The ...
Development

No branches or pull requests

4 participants