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

Allow non-superusers to run ALTER TABLE REROUTE commands #15891

Open
hlcianfagna opened this issue Apr 23, 2024 · 3 comments
Open

Allow non-superusers to run ALTER TABLE REROUTE commands #15891

hlcianfagna opened this issue Apr 23, 2024 · 3 comments

Comments

@hlcianfagna
Copy link
Contributor

hlcianfagna commented Apr 23, 2024

Problem Statement

In CrateDB Cloud and other security-sensitive setups, database admins may not routinely have access to the crate superuser account.
The ALTER TABLE ... REROUTE MOVE SHARD commands are useful to move around "hot shards" as described in the documentation.
Currently these operations are not allowed even when a user account has AL and DDL permissions at cluster level.

Possible Solutions

  • Allow the operations for accounts with certain permissions so that the task can be delegated and run without connecting as crate
  • Cover REROUTE use cases in some other way so that manual rerouting is not necessary

Considered Alternatives

Get an admin with access to the CrateDB nodes to connect locally as crate and run the required commands.

@mfussenegger
Copy link
Member

mfussenegger commented May 27, 2024

TBD which option to use:

@matriv
Copy link
Contributor

matriv commented Jun 7, 2024

Imho, users with AL should be able to execute this. The ability to inherit superuser to a role/user, would be a way to do that, but I believe explicit granting of AL should also work.

@BaurzhanSakhariev
Copy link
Contributor

BaurzhanSakhariev commented Jun 10, 2024

Imho, users with AL should be able to execute this. The ability to inherit superuser to a role/user, would be a way to do that, but I believe explicit granting of AL should also work.

Makes sense to me, as we already allow non-superusers to run ALTER CLUSTER commands (#11283)

ALTER CLUSTER is a more "global" command so it's probably logical for users to expect
that they can also run ALTER TABLE REROUTE with AL privileges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Could
Development

No branches or pull requests

4 participants